57 $bits = explode(
' ', $string);
60 $keywords[
'h'] =
false;
61 $keywords[
'v'] =
false;
62 $keywords[
'c'] =
false;
75 foreach ($bits as $bit) {
76 if ($bit ===
'')
continue;
79 $lbit = ctype_lower($bit) ? $bit : strtolower($bit);
80 if (isset($lookup[$lbit])) {
81 $status = $lookup[$lbit];
82 $keywords[$status] = $lbit;
87 $r = $this->length->validate($bit,
$config, $context);
94 $r = $this->percentage->validate($bit,
$config, $context);
102 if (!$i)
return false;
108 if ($keywords[
'h'])
$ret[] = $keywords[
'h'];
109 elseif (count($measures))
$ret[] = array_shift($measures);
111 $ret[] = $keywords[
'c'];
112 $keywords[
'c'] =
false;
115 if ($keywords[
'v'])
$ret[] = $keywords[
'v'];
116 elseif (count($measures))
$ret[] = array_shift($measures);
117 elseif ($keywords[
'c'])
$ret[] = $keywords[
'c'];
119 if (empty(
$ret))
return false;
120 return implode(
' ',
$ret);