Add STRIP option

This commit is contained in:
bzick
2014-05-08 12:56:37 +04:00
parent 83e02ebbe9
commit 45afbfabdf
12 changed files with 209 additions and 87 deletions

View File

@@ -140,7 +140,7 @@ class Modifier
{
$str = trim($str);
if ($to_line) {
return preg_replace('#[\s]+#ms', ' ', $str);
return preg_replace('#\s+#ms', ' ', $str);
} else {
return preg_replace('#[ \t]{2,}#', ' ', $str);
}
@@ -158,7 +158,7 @@ class Modifier
} elseif (is_array($item)) {
return count($item);
} elseif ($item instanceof \Countable) {
return count($item);
return $item->count();
} else {
return 0;
}