@@ 39-51 (lines=13) @@ | ||
36 | $bits = explode(' ', $string); |
|
37 | $done = array(); // segments we've finished |
|
38 | $ret = ''; // return value |
|
39 | foreach ($bits as $bit) { |
|
40 | foreach ($this->info as $propname => $validator) { |
|
41 | if (isset($done[$propname])) { |
|
42 | continue; |
|
43 | } |
|
44 | $r = $validator->validate($bit, $config, $context); |
|
45 | if ($r !== false) { |
|
46 | $ret .= $r . ' '; |
|
47 | $done[$propname] = true; |
|
48 | break; |
|
49 | } |
|
50 | } |
|
51 | } |
|
52 | return rtrim($ret); |
|
53 | } |
|
54 | } |
@@ 74-88 (lines=15) @@ | ||
71 | } |
|
72 | switch ($stage) { |
|
73 | case 0: // attempting to catch font-style, font-variant or font-weight |
|
74 | foreach ($stage_1 as $validator_name) { |
|
75 | if (isset($caught[$validator_name])) { |
|
76 | continue; |
|
77 | } |
|
78 | $r = $this->info[$validator_name]->validate( |
|
79 | $bits[$i], |
|
80 | $config, |
|
81 | $context |
|
82 | ); |
|
83 | if ($r !== false) { |
|
84 | $final .= $r . ' '; |
|
85 | $caught[$validator_name] = true; |
|
86 | break; |
|
87 | } |
|
88 | } |
|
89 | // all three caught, continue on |
|
90 | if (count($caught) >= 3) { |
|
91 | $stage = 1; |