Skip to content

Commit

Permalink
add new filter: clearSpace
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Dec 26, 2017
1 parent 2c26045 commit 2c452c9
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Filter/FilterList.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,20 @@ public static function stripped($val, $flags = 0)
public static function trim($val)
{
return \is_array($val) ? array_map(function ($val) {
return \is_string($val) ? trim($val) : $val;
}, $val) : trim((string)$val);
return \is_string($val) ? \trim($val) : $val;
}, $val) : \trim((string)$val);
}

/**
* clear space
* @param string $val
* @return mixed
*/
public static function clearSpace($val)
{
return str_replace(' ', '', \trim($val));
}

/**
* string to lowercase
* @param string $val
Expand Down

0 comments on commit 2c452c9

Please sign in to comment.