@@ -14,10 +14,14 @@ discard block |
||
14 | 14 | |
15 | 15 | public function match($pseudo, \DomElement $element) { |
16 | 16 | $pos = strpos($pseudo, '['); |
17 | - if ($pos === false) return true; |
|
17 | + if ($pos === false) { |
|
18 | + return true; |
|
19 | + } |
|
18 | 20 | |
19 | 21 | $name = substr($pseudo, 0, $pos); |
20 | - if (!is_callable([$this->functionSet, $name])) return true; |
|
22 | + if (!is_callable([$this->functionSet, $name])) { |
|
23 | + return true; |
|
24 | + } |
|
21 | 25 | |
22 | 26 | $bracketMatcher = new \Transphporm\Parser\BracketMatcher($pseudo); |
23 | 27 | $criteria = $bracketMatcher->match('[', ']'); |
@@ -43,16 +47,21 @@ discard block |
||
43 | 47 | } |
44 | 48 | |
45 | 49 | private function parseValue($value) { |
46 | - if ($value == 'true') return true; |
|
47 | - else if ($value == 'false') return false; |
|
48 | - else return $value; |
|
50 | + if ($value == 'true') { |
|
51 | + return true; |
|
52 | + } else if ($value == 'false') { |
|
53 | + return false; |
|
54 | + } else { |
|
55 | + return $value; |
|
56 | + } |
|
49 | 57 | } |
50 | 58 | |
51 | 59 | private function getOperator($field) { |
52 | 60 | if ($field[strlen($field)-1] == '!') { |
53 | 61 | return '!'; |
62 | + } else { |
|
63 | + return ''; |
|
54 | 64 | } |
55 | - else return ''; |
|
56 | 65 | } |
57 | 66 | |
58 | 67 | } |