@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | public function setContext($rules) |
| 72 | 72 | { |
| 73 | - if(is_callable($rules)) { |
|
| 73 | + if (is_callable($rules)) { |
|
| 74 | 74 | $this->_validator = $rules; |
| 75 | 75 | } else { |
| 76 | 76 | $this->_context = []; |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | public function validate($context, array $additional = []) |
| 126 | 126 | { |
| 127 | - if(is_callable($this->_validator)) { |
|
| 127 | + if (is_callable($this->_validator)) { |
|
| 128 | 128 | $validator = $this->_validator; |
| 129 | 129 | return $validator($context, $additional); |
| 130 | 130 | } else { |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | reset($rules); |
| 143 | 143 | while (list($rule, $type) = each($rules)) { |
| 144 | 144 | $matched = !($type & self::CONTEXT_EXACTLY) ? |
| 145 | - count(array_filter($context, function ($a) use ($rule) { |
|
| 145 | + count(array_filter($context, function($a) use ($rule) { |
|
| 146 | 146 | return $a === $rule || fnmatch($rule . '.*', $a); |
| 147 | 147 | })) > 0 : |
| 148 | 148 | in_array($rule, $context, true); |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | private function _unsetUnnecessaryRules($rule, &$required) |
| 174 | 174 | { |
| 175 | 175 | if (strpos($rule, '.') !== false) { |
| 176 | - foreach (array_filter(array_keys($this->_context), function ($key) use ($rule) { |
|
| 176 | + foreach (array_filter(array_keys($this->_context), function($key) use ($rule) { |
|
| 177 | 177 | return fnmatch($key . '.*', $rule); |
| 178 | 178 | }) as $remove) { |
| 179 | 179 | unset($required[$remove]); |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | |
| 194 | 194 | public static function everywhere() { |
| 195 | 195 | static $callable; |
| 196 | - if(!$callable) { |
|
| 196 | + if (!$callable) { |
|
| 197 | 197 | $callable = function() { |
| 198 | 198 | return true; |
| 199 | 199 | }; |
@@ -34,9 +34,9 @@ |
||
| 34 | 34 | |
| 35 | 35 | if ($this->isStart()) { |
| 36 | 36 | $lang = $this->_rule->language; |
| 37 | - if($lang === null && $this->getInjected() !== $language) { |
|
| 37 | + if ($lang === null && $this->getInjected() !== $language) { |
|
| 38 | 38 | $valid = true; |
| 39 | - } elseif($language === $lang && $this->_rule->validate($context)) { |
|
| 39 | + } elseif ($language === $lang && $this->_rule->validate($context)) { |
|
| 40 | 40 | $valid = true; |
| 41 | 41 | } |
| 42 | 42 | } else { |