@@ -35,9 +35,9 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | public static function findSymbolicOperator($english_operator) |
| 37 | 37 | { |
| 38 | - $association = array_flip( self::$ruleAliases ); |
|
| 39 | - if (isset($association[ $english_operator ])) { |
|
| 40 | - return $association[ $english_operator ]; |
|
| 38 | + $association = array_flip(self::$ruleAliases); |
|
| 39 | + if (isset($association[$english_operator])) { |
|
| 40 | + return $association[$english_operator]; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | return $english_operator; |
@@ -50,8 +50,8 @@ discard block |
||
| 50 | 50 | public static function findEnglishOperator($symbolic_operator) |
| 51 | 51 | { |
| 52 | 52 | $association = self::$ruleAliases; |
| 53 | - if (isset($association[ $symbolic_operator ])) { |
|
| 54 | - return $association[ $symbolic_operator ]; |
|
| 53 | + if (isset($association[$symbolic_operator])) { |
|
| 54 | + return $association[$symbolic_operator]; |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | return $symbolic_operator; |
@@ -70,16 +70,16 @@ discard block |
||
| 70 | 70 | * |
| 71 | 71 | * @return AbstractRule |
| 72 | 72 | */ |
| 73 | - public static function generateSimpleRule($field, $type, $values, array $options=[]) |
|
| 73 | + public static function generateSimpleRule($field, $type, $values, array $options = []) |
|
| 74 | 74 | { |
| 75 | - $cache_key = hash('md4', serialize( func_get_args()) ); |
|
| 75 | + $cache_key = hash('md4', serialize(func_get_args())); |
|
| 76 | 76 | if (isset(self::$static_cache['rules_generation'][$cache_key])) { |
| 77 | 77 | return self::$static_cache['rules_generation'][$cache_key]->copy(); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | $ruleClass = self::getRuleClass($type); |
| 81 | 81 | |
| 82 | - return self::$static_cache['rules_generation'][$cache_key] = new $ruleClass( $field, $values, $options ); |
|
| 82 | + return self::$static_cache['rules_generation'][$cache_key] = new $ruleClass($field, $values, $options); |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /** |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | . str_replace('_', '', ucwords($english_rule_operator, '_')) |
| 97 | 97 | . 'Rule'; |
| 98 | 98 | |
| 99 | - if ( ! class_exists( $rule_class)) { |
|
| 99 | + if ( ! class_exists($rule_class)) { |
|
| 100 | 100 | throw new \InvalidArgumentException( |
| 101 | 101 | "The class '$rule_class' corresponding to the operator " |
| 102 | 102 | ."'$rule_operator' / '$english_rule_operator' cannot be found." |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | * |
| 126 | 126 | * @return $this |
| 127 | 127 | */ |
| 128 | - final public function dump($exit=false, array $options=[]) |
|
| 128 | + final public function dump($exit = false, array $options = []) |
|
| 129 | 129 | { |
| 130 | 130 | $default_options = [ |
| 131 | 131 | 'callstack_depth' => 2, |
@@ -133,16 +133,16 @@ discard block |
||
| 133 | 133 | // 'show_instance' => false, |
| 134 | 134 | ]; |
| 135 | 135 | foreach ($default_options as $default_option => &$default_value) { |
| 136 | - if ( ! isset($options[ $default_option ])) { |
|
| 137 | - $options[ $default_option ] = $default_value; |
|
| 136 | + if ( ! isset($options[$default_option])) { |
|
| 137 | + $options[$default_option] = $default_value; |
|
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | 140 | extract($options); |
| 141 | 141 | |
| 142 | 142 | $bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, $callstack_depth); |
| 143 | - $caller = $bt[ $callstack_depth - 2 ]; |
|
| 143 | + $caller = $bt[$callstack_depth - 2]; |
|
| 144 | 144 | |
| 145 | - echo "\n" . $caller['file'] . ':' . $caller['line'] . "\n"; |
|
| 145 | + echo "\n".$caller['file'].':'.$caller['line']."\n"; |
|
| 146 | 146 | if ('string' == $mode) { |
| 147 | 147 | if ( ! isset($options['indent_unit'])) { |
| 148 | 148 | $options['indent_unit'] = " "; |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | else { |
| 186 | 186 | throw new \InvalidArgumentException( |
| 187 | 187 | "'mode' option must belong to ['string', 'export', 'dump'] " |
| 188 | - ."instead of " . var_export($mode, true) |
|
| 188 | + ."instead of ".var_export($mode, true) |
|
| 189 | 189 | ); |
| 190 | 190 | } |
| 191 | 191 | echo "\n\n"; |
@@ -240,12 +240,12 @@ discard block |
||
| 240 | 240 | /** |
| 241 | 241 | * @return string |
| 242 | 242 | */ |
| 243 | - abstract public function toString(array $options=[]); |
|
| 243 | + abstract public function toString(array $options = []); |
|
| 244 | 244 | |
| 245 | 245 | /** |
| 246 | 246 | * @return array |
| 247 | 247 | */ |
| 248 | - abstract public function toArray(array $options=[]); |
|
| 248 | + abstract public function toArray(array $options = []); |
|
| 249 | 249 | |
| 250 | 250 | protected $instance_id; |
| 251 | 251 | |
@@ -276,9 +276,9 @@ discard block |
||
| 276 | 276 | return $this->cache['semantic_id']; |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | - return hash('md4', serialize( $this->toArray(['semantic' => true]) )) // faster but longer |
|
| 279 | + return hash('md4', serialize($this->toArray(['semantic' => true]))) // faster but longer |
|
| 280 | 280 | .'-' |
| 281 | - .hash('md4', serialize( $this->options )) |
|
| 281 | + .hash('md4', serialize($this->options)) |
|
| 282 | 282 | ; |
| 283 | 283 | } |
| 284 | 284 | |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | */ |
| 297 | 297 | protected function forceLogicalCore() |
| 298 | 298 | { |
| 299 | - if ( $this instanceof AbstractAtomicRule |
|
| 299 | + if ($this instanceof AbstractAtomicRule |
|
| 300 | 300 | || $this instanceof NotRule |
| 301 | 301 | || $this instanceof InRule |
| 302 | 302 | || ! $this->isNormalizationAllowed([]) |