@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $options = $options->toArray(); |
49 | 49 | } |
50 | 50 | |
51 | - if (! is_array($options) && ! $options instanceof Traversable) { |
|
51 | + if (!is_array($options) && !$options instanceof Traversable) { |
|
52 | 52 | throw new Exception\InvalidArgumentException( |
53 | 53 | sprintf( |
54 | 54 | 'Parameter provided to %s must be an %s, %s or %s', |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | public function toArray() |
76 | 76 | { |
77 | 77 | $array = []; |
78 | - $transform = function ($letters) { |
|
78 | + $transform = function($letters) { |
|
79 | 79 | $letter = array_shift($letters); |
80 | - return '_' . strtolower($letter); |
|
80 | + return '_'.strtolower($letter); |
|
81 | 81 | }; |
82 | 82 | foreach ($this as $key => $value) { |
83 | 83 | if ($key === '__strictMode__') { |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | */ |
101 | 101 | public function __set($key, $value) |
102 | 102 | { |
103 | - $setter = 'set' . str_replace('_', '', $key); |
|
103 | + $setter = 'set'.str_replace('_', '', $key); |
|
104 | 104 | |
105 | 105 | if (is_callable([$this, $setter])) { |
106 | 106 | $this->{$setter}($value); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | throw new Exception\BadMethodCallException(sprintf( |
113 | 113 | 'The option "%s" does not have a callable "%s" ("%s") setter method which must be defined', |
114 | 114 | $key, |
115 | - 'set' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key))), |
|
115 | + 'set'.str_replace(' ', '', ucwords(str_replace('_', ' ', $key))), |
|
116 | 116 | $setter |
117 | 117 | )); |
118 | 118 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | */ |
129 | 129 | public function __get($key) |
130 | 130 | { |
131 | - $getter = 'get' . str_replace('_', '', $key); |
|
131 | + $getter = 'get'.str_replace('_', '', $key); |
|
132 | 132 | |
133 | 133 | if (is_callable([$this, $getter])) { |
134 | 134 | return $this->{$getter}(); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | throw new Exception\BadMethodCallException(sprintf( |
138 | 138 | 'The option "%s" does not have a callable "%s" getter method which must be defined', |
139 | 139 | $key, |
140 | - 'get' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key))) |
|
140 | + 'get'.str_replace(' ', '', ucwords(str_replace('_', ' ', $key))) |
|
141 | 141 | )); |
142 | 142 | } |
143 | 143 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | */ |
150 | 150 | public function __isset($key) |
151 | 151 | { |
152 | - $getter = 'get' . str_replace('_', '', $key); |
|
152 | + $getter = 'get'.str_replace('_', '', $key); |
|
153 | 153 | |
154 | 154 | return method_exists($this, $getter) && null !== $this->__get($key); |
155 | 155 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $this->__set($key, null); |
169 | 169 | } catch (Exception\BadMethodCallException $e) { |
170 | 170 | throw new Exception\InvalidArgumentException( |
171 | - 'The class property $' . $key . ' cannot be unset as' |
|
171 | + 'The class property $'.$key.' cannot be unset as' |
|
172 | 172 | . ' NULL is an invalid value for it', |
173 | 173 | 0, |
174 | 174 | $e |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | { |
131 | 131 | $ret = null; |
132 | 132 | if ($this->flag == self::ARRAY_AS_PROPS) { |
133 | - $ret =& $this->offsetGet($key); |
|
133 | + $ret = & $this->offsetGet($key); |
|
134 | 134 | |
135 | 135 | return $ret; |
136 | 136 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | */ |
181 | 181 | public function exchangeArray($data) |
182 | 182 | { |
183 | - if (! is_array($data) && ! is_object($data)) { |
|
183 | + if (!is_array($data) && !is_object($data)) { |
|
184 | 184 | throw new Exception\InvalidArgumentException( |
185 | 185 | 'Passed variable is not an array or object, using empty array instead' |
186 | 186 | ); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | if (is_object($data) && ($data instanceof self || $data instanceof \ArrayObject)) { |
190 | 190 | $data = $data->getArrayCopy(); |
191 | 191 | } |
192 | - if (! is_array($data)) { |
|
192 | + if (!is_array($data)) { |
|
193 | 193 | $data = (array) $data; |
194 | 194 | } |
195 | 195 | |
@@ -292,10 +292,10 @@ discard block |
||
292 | 292 | public function &offsetGet($key) |
293 | 293 | { |
294 | 294 | $ret = null; |
295 | - if (! $this->offsetExists($key)) { |
|
295 | + if (!$this->offsetExists($key)) { |
|
296 | 296 | return $ret; |
297 | 297 | } |
298 | - $ret =& $this->storage[$key]; |
|
298 | + $ret = & $this->storage[$key]; |
|
299 | 299 | |
300 | 300 | return $ret; |
301 | 301 | } |
@@ -357,15 +357,15 @@ discard block |
||
357 | 357 | if (class_exists($class)) { |
358 | 358 | $this->iteratorClass = $class; |
359 | 359 | |
360 | - return ; |
|
360 | + return; |
|
361 | 361 | } |
362 | 362 | |
363 | 363 | if (strpos($class, '\\') === 0) { |
364 | - $class = '\\' . $class; |
|
364 | + $class = '\\'.$class; |
|
365 | 365 | if (class_exists($class)) { |
366 | 366 | $this->iteratorClass = $class; |
367 | 367 | |
368 | - return ; |
|
368 | + return; |
|
369 | 369 | } |
370 | 370 | } |
371 | 371 |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * with keys "data" and "priority". |
43 | 43 | * @var array |
44 | 44 | */ |
45 | - protected $items = []; |
|
45 | + protected $items = []; |
|
46 | 46 | |
47 | 47 | /** |
48 | 48 | * Inner queue object |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | unset($this->items[$key]); |
100 | 100 | $this->queue = null; |
101 | 101 | |
102 | - if (! $this->isEmpty()) { |
|
102 | + if (!$this->isEmpty()) { |
|
103 | 103 | $queue = $this->getQueue(); |
104 | 104 | foreach ($this->items as $item) { |
105 | 105 | $queue->insert($item['data'], $item['priority']); |
@@ -209,12 +209,12 @@ discard block |
||
209 | 209 | case self::EXTR_BOTH: |
210 | 210 | return $this->items; |
211 | 211 | case self::EXTR_PRIORITY: |
212 | - return array_map(function ($item) { |
|
212 | + return array_map(function($item) { |
|
213 | 213 | return $item['priority']; |
214 | 214 | }, $this->items); |
215 | 215 | case self::EXTR_DATA: |
216 | 216 | default: |
217 | - return array_map(function ($item) { |
|
217 | + return array_map(function($item) { |
|
218 | 218 | return $item['data']; |
219 | 219 | }, $this->items); |
220 | 220 | } |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | { |
278 | 278 | if (null === $this->queue) { |
279 | 279 | $this->queue = new $this->queueClass(); |
280 | - if (! $this->queue instanceof \SplPriorityQueue) { |
|
280 | + if (!$this->queue instanceof \SplPriorityQueue) { |
|
281 | 281 | throw new Exception\DomainException(sprintf( |
282 | 282 | 'PriorityQueue expects an internal queue of type SplPriorityQueue; received "%s"', |
283 | 283 | get_class($this->queue) |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | */ |
215 | 215 | public function __construct() |
216 | 216 | { |
217 | - if (! extension_loaded('iconv')) { |
|
217 | + if (!extension_loaded('iconv')) { |
|
218 | 218 | throw new Exception\ExtensionNotLoadedException( |
219 | 219 | 'PHP extension "iconv" is required for this wrapper' |
220 | 220 | ); |
@@ -284,6 +284,6 @@ discard block |
||
284 | 284 | |
285 | 285 | // automatically add "//IGNORE" to not stop converting on invalid characters |
286 | 286 | // invalid characters triggers a notice anyway |
287 | - return iconv($fromEncoding, $toEncoding . '//IGNORE', $str); |
|
287 | + return iconv($fromEncoding, $toEncoding.'//IGNORE', $str); |
|
288 | 288 | } |
289 | 289 | } |
@@ -48,7 +48,7 @@ |
||
48 | 48 | */ |
49 | 49 | public function __construct() |
50 | 50 | { |
51 | - if (! extension_loaded('mbstring')) { |
|
51 | + if (!extension_loaded('mbstring')) { |
|
52 | 52 | throw new Exception\ExtensionNotLoadedException( |
53 | 53 | 'PHP extension "mbstring" is required for this wrapper' |
54 | 54 | ); |
@@ -99,7 +99,7 @@ |
||
99 | 99 | * Get the defined character encoding to convert to |
100 | 100 | * |
101 | 101 | * @return string|null |
102 | - */ |
|
102 | + */ |
|
103 | 103 | public function getConvertEncoding() |
104 | 104 | { |
105 | 105 | return $this->convertEncoding; |
@@ -38,11 +38,11 @@ discard block |
||
38 | 38 | { |
39 | 39 | $supportedEncodings = static::getSupportedEncodings(); |
40 | 40 | |
41 | - if (! in_array(strtoupper($encoding), $supportedEncodings)) { |
|
41 | + if (!in_array(strtoupper($encoding), $supportedEncodings)) { |
|
42 | 42 | return false; |
43 | 43 | } |
44 | 44 | |
45 | - if ($convertEncoding !== null && ! in_array(strtoupper($convertEncoding), $supportedEncodings)) { |
|
45 | + if ($convertEncoding !== null && !in_array(strtoupper($convertEncoding), $supportedEncodings)) { |
|
46 | 46 | return false; |
47 | 47 | } |
48 | 48 | |
@@ -61,17 +61,17 @@ discard block |
||
61 | 61 | $supportedEncodings = static::getSupportedEncodings(); |
62 | 62 | |
63 | 63 | $encodingUpper = strtoupper($encoding); |
64 | - if (! in_array($encodingUpper, $supportedEncodings)) { |
|
64 | + if (!in_array($encodingUpper, $supportedEncodings)) { |
|
65 | 65 | throw new Exception\InvalidArgumentException( |
66 | - 'Wrapper doesn\'t support character encoding "' . $encoding . '"' |
|
66 | + 'Wrapper doesn\'t support character encoding "'.$encoding.'"' |
|
67 | 67 | ); |
68 | 68 | } |
69 | 69 | |
70 | 70 | if ($convertEncoding !== null) { |
71 | 71 | $convertEncodingUpper = strtoupper($convertEncoding); |
72 | - if (! in_array($convertEncodingUpper, $supportedEncodings)) { |
|
72 | + if (!in_array($convertEncodingUpper, $supportedEncodings)) { |
|
73 | 73 | throw new Exception\InvalidArgumentException( |
74 | - 'Wrapper doesn\'t support character encoding "' . $convertEncoding . '"' |
|
74 | + 'Wrapper doesn\'t support character encoding "'.$convertEncoding.'"' |
|
75 | 75 | ); |
76 | 76 | } |
77 | 77 | |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | |
189 | 189 | if ($char === ' ') { |
190 | 190 | if ($current - $lastStart >= $width) { |
191 | - $result .= $this->substr($string, $lastStart, $current - $lastStart) . $break; |
|
191 | + $result .= $this->substr($string, $lastStart, $current - $lastStart).$break; |
|
192 | 192 | $lastStart = $current + 1; |
193 | 193 | } |
194 | 194 | |
@@ -197,13 +197,13 @@ discard block |
||
197 | 197 | } |
198 | 198 | |
199 | 199 | if ($current - $lastStart >= $width && $cut && $lastStart >= $lastSpace) { |
200 | - $result .= $this->substr($string, $lastStart, $current - $lastStart) . $break; |
|
200 | + $result .= $this->substr($string, $lastStart, $current - $lastStart).$break; |
|
201 | 201 | $lastStart = $lastSpace = $current; |
202 | 202 | continue; |
203 | 203 | } |
204 | 204 | |
205 | 205 | if ($current - $lastStart >= $width && $lastStart < $lastSpace) { |
206 | - $result .= $this->substr($string, $lastStart, $lastSpace - $lastStart) . $break; |
|
206 | + $result .= $this->substr($string, $lastStart, $lastSpace - $lastStart).$break; |
|
207 | 207 | $lastStart = $lastSpace = $lastSpace + 1; |
208 | 208 | continue; |
209 | 209 | } |
@@ -253,17 +253,17 @@ discard block |
||
253 | 253 | $lastStringLeft = $this->substr($padString, 0, $lastStringLeftLength); |
254 | 254 | $lastStringRight = $this->substr($padString, 0, $lastStringRightLength); |
255 | 255 | |
256 | - return str_repeat($padString, $repeatCountLeft) . $lastStringLeft |
|
256 | + return str_repeat($padString, $repeatCountLeft).$lastStringLeft |
|
257 | 257 | . $input |
258 | - . str_repeat($padString, $repeatCountRight) . $lastStringRight; |
|
258 | + . str_repeat($padString, $repeatCountRight).$lastStringRight; |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | $lastString = $this->substr($padString, 0, $lengthOfPadding % $padStringLength); |
262 | 262 | |
263 | 263 | if ($padType === STR_PAD_LEFT) { |
264 | - return str_repeat($padString, $repeatCount) . $lastString . $input; |
|
264 | + return str_repeat($padString, $repeatCount).$lastString.$input; |
|
265 | 265 | } |
266 | 266 | |
267 | - return $input . str_repeat($padString, $repeatCount) . $lastString; |
|
267 | + return $input.str_repeat($padString, $repeatCount).$lastString; |
|
268 | 268 | } |
269 | 269 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | */ |
38 | 38 | public function __construct() |
39 | 39 | { |
40 | - if (! extension_loaded('intl')) { |
|
40 | + if (!extension_loaded('intl')) { |
|
41 | 41 | throw new Exception\ExtensionNotLoadedException( |
42 | 42 | 'PHP extension "intl" is required for this wrapper' |
43 | 43 | ); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $encodingUpper = strtoupper($encoding); |
36 | 36 | $supportedEncodings = static::getSupportedEncodings(); |
37 | 37 | |
38 | - if (! in_array($encodingUpper, $supportedEncodings)) { |
|
38 | + if (!in_array($encodingUpper, $supportedEncodings)) { |
|
39 | 39 | return false; |
40 | 40 | } |
41 | 41 | |
@@ -69,9 +69,9 @@ discard block |
||
69 | 69 | $supportedEncodings = static::getSupportedEncodings(); |
70 | 70 | |
71 | 71 | $encodingUpper = strtoupper($encoding); |
72 | - if (! in_array($encodingUpper, $supportedEncodings)) { |
|
72 | + if (!in_array($encodingUpper, $supportedEncodings)) { |
|
73 | 73 | throw new Exception\InvalidArgumentException( |
74 | - 'Wrapper doesn\'t support character encoding "' . $encoding . '"' |
|
74 | + 'Wrapper doesn\'t support character encoding "'.$encoding.'"' |
|
75 | 75 | ); |
76 | 76 | } |
77 | 77 |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | /** |
29 | 29 | * Compatibility Flag for ArrayUtils::filter |
30 | 30 | */ |
31 | - const ARRAY_FILTER_USE_KEY = 2; |
|
31 | + const ARRAY_FILTER_USE_KEY = 2; |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Test whether an array contains one or more string keys |
@@ -39,11 +39,11 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public static function hasStringKeys($value, $allowEmpty = false) |
41 | 41 | { |
42 | - if (! is_array($value)) { |
|
42 | + if (!is_array($value)) { |
|
43 | 43 | return false; |
44 | 44 | } |
45 | 45 | |
46 | - if (! $value) { |
|
46 | + if (!$value) { |
|
47 | 47 | return $allowEmpty; |
48 | 48 | } |
49 | 49 | |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public static function hasIntegerKeys($value, $allowEmpty = false) |
61 | 61 | { |
62 | - if (! is_array($value)) { |
|
62 | + if (!is_array($value)) { |
|
63 | 63 | return false; |
64 | 64 | } |
65 | 65 | |
66 | - if (! $value) { |
|
66 | + if (!$value) { |
|
67 | 67 | return $allowEmpty; |
68 | 68 | } |
69 | 69 | |
@@ -86,11 +86,11 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public static function hasNumericKeys($value, $allowEmpty = false) |
88 | 88 | { |
89 | - if (! is_array($value)) { |
|
89 | + if (!is_array($value)) { |
|
90 | 90 | return false; |
91 | 91 | } |
92 | 92 | |
93 | - if (! $value) { |
|
93 | + if (!$value) { |
|
94 | 94 | return $allowEmpty; |
95 | 95 | } |
96 | 96 | |
@@ -119,11 +119,11 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public static function isList($value, $allowEmpty = false) |
121 | 121 | { |
122 | - if (! is_array($value)) { |
|
122 | + if (!is_array($value)) { |
|
123 | 123 | return false; |
124 | 124 | } |
125 | 125 | |
126 | - if (! $value) { |
|
126 | + if (!$value) { |
|
127 | 127 | return $allowEmpty; |
128 | 128 | } |
129 | 129 | |
@@ -161,11 +161,11 @@ discard block |
||
161 | 161 | */ |
162 | 162 | public static function isHashTable($value, $allowEmpty = false) |
163 | 163 | { |
164 | - if (! is_array($value)) { |
|
164 | + if (!is_array($value)) { |
|
165 | 165 | return false; |
166 | 166 | } |
167 | 167 | |
168 | - if (! $value) { |
|
168 | + if (!$value) { |
|
169 | 169 | return $allowEmpty; |
170 | 170 | } |
171 | 171 | |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | */ |
188 | 188 | public static function inArray($needle, array $haystack, $strict = false) |
189 | 189 | { |
190 | - if (! $strict) { |
|
190 | + if (!$strict) { |
|
191 | 191 | if (is_int($needle) || is_float($needle)) { |
192 | 192 | $needle = (string) $needle; |
193 | 193 | } |
@@ -215,11 +215,11 @@ discard block |
||
215 | 215 | */ |
216 | 216 | public static function iteratorToArray($iterator, $recursive = true) |
217 | 217 | { |
218 | - if (! is_array($iterator) && ! $iterator instanceof Traversable) { |
|
219 | - throw new Exception\InvalidArgumentException(__METHOD__ . ' expects an array or Traversable object'); |
|
218 | + if (!is_array($iterator) && !$iterator instanceof Traversable) { |
|
219 | + throw new Exception\InvalidArgumentException(__METHOD__.' expects an array or Traversable object'); |
|
220 | 220 | } |
221 | 221 | |
222 | - if (! $recursive) { |
|
222 | + if (!$recursive) { |
|
223 | 223 | if (is_array($iterator)) { |
224 | 224 | return $iterator; |
225 | 225 | } |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | } elseif (isset($a[$key]) || array_key_exists($key, $a)) { |
275 | 275 | if ($value instanceof MergeRemoveKey) { |
276 | 276 | unset($a[$key]); |
277 | - } elseif (! $preserveNumericKeys && is_int($key)) { |
|
277 | + } elseif (!$preserveNumericKeys && is_int($key)) { |
|
278 | 278 | $a[] = $value; |
279 | 279 | } elseif (is_array($value) && is_array($a[$key])) { |
280 | 280 | $a[$key] = static::merge($a[$key], $value, $preserveNumericKeys); |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | $a[$key] = $value; |
283 | 283 | } |
284 | 284 | } else { |
285 | - if (! $value instanceof MergeRemoveKey) { |
|
285 | + if (!$value instanceof MergeRemoveKey) { |
|
286 | 286 | $a[$key] = $value; |
287 | 287 | } |
288 | 288 | } |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | */ |
303 | 303 | public static function filter(array $data, $callback, $flag = null) |
304 | 304 | { |
305 | - if (! is_callable($callback)) { |
|
305 | + if (!is_callable($callback)) { |
|
306 | 306 | throw new Exception\InvalidArgumentException(sprintf( |
307 | 307 | 'Second parameter of %s must be callable', |
308 | 308 | __METHOD__ |