@@ -44,11 +44,11 @@ discard block |
||
44 | 44 | |
45 | 45 | return array_reduce( |
46 | 46 | $words, |
47 | - function ($result, $word) use ($words) { |
|
47 | + function($result, $word) use ($words) { |
|
48 | 48 | $isFirst = __::first($words) === $word; |
49 | 49 | $word = __::toLower($word); |
50 | 50 | |
51 | - return $result . (!$isFirst ? __::capitalize($word) : $word); |
|
51 | + return $result.(!$isFirst ? __::capitalize($word) : $word); |
|
52 | 52 | }, |
53 | 53 | '' |
54 | 54 | ); |
@@ -87,10 +87,10 @@ discard block |
||
87 | 87 | |
88 | 88 | return array_reduce( |
89 | 89 | $words, |
90 | - function ($result, $word) use ($words) { |
|
90 | + function($result, $word) use ($words) { |
|
91 | 91 | $isFirst = __::first($words) === $word; |
92 | 92 | |
93 | - return $result . (!$isFirst ? '-' : '') . __::toLower($word); |
|
93 | + return $result.(!$isFirst ? '-' : '').__::toLower($word); |
|
94 | 94 | }, |
95 | 95 | '' |
96 | 96 | ); |
@@ -129,10 +129,10 @@ discard block |
||
129 | 129 | |
130 | 130 | return array_reduce( |
131 | 131 | $words, |
132 | - function ($result, $word) use ($words) { |
|
132 | + function($result, $word) use ($words) { |
|
133 | 133 | $isFirst = __::first($words) === $word; |
134 | 134 | |
135 | - return $result . (!$isFirst ? '_' : '') . __::toLower($word); |
|
135 | + return $result.(!$isFirst ? '_' : '').__::toLower($word); |
|
136 | 136 | }, |
137 | 137 | '' |
138 | 138 | ); |
@@ -156,10 +156,10 @@ discard block |
||
156 | 156 | |
157 | 157 | return array_reduce( |
158 | 158 | $words, |
159 | - function ($result, $word) use ($words) { |
|
159 | + function($result, $word) use ($words) { |
|
160 | 160 | $isFirst = __::first($words) === $word; |
161 | 161 | |
162 | - return $result . (!$isFirst ? ' ' : '') . __::upperFirst($word); |
|
162 | + return $result.(!$isFirst ? ' ' : '').__::upperFirst($word); |
|
163 | 163 | }, |
164 | 164 | '' |
165 | 165 | ); |
@@ -211,10 +211,10 @@ discard block |
||
211 | 211 | |
212 | 212 | return array_reduce( |
213 | 213 | $words, |
214 | - function ($result, $word) use ($words) { |
|
214 | + function($result, $word) use ($words) { |
|
215 | 215 | $isFirst = __::first($words) === $word; |
216 | 216 | |
217 | - return $result . (!$isFirst ? ' ' : '') . __::toUpper($word); |
|
217 | + return $result.(!$isFirst ? ' ' : '').__::toUpper($word); |
|
218 | 218 | }, |
219 | 219 | '' |
220 | 220 | ); |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | $rsComboMarksRange = '\x{0300}-\x{036f}'; |
257 | 257 | $reComboHalfMarksRange = '\x{fe20}-\x{fe2f}'; |
258 | 258 | $rsComboSymbolsRange = '\x{20d0}-\x{20ff}'; |
259 | - $rsComboRange = $rsComboMarksRange . $reComboHalfMarksRange . $rsComboSymbolsRange; |
|
259 | + $rsComboRange = $rsComboMarksRange.$reComboHalfMarksRange.$rsComboSymbolsRange; |
|
260 | 260 | $rsDingbatRange = '\x{2700}-\x{27bf}'; |
261 | 261 | $rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff'; |
262 | 262 | $rsMathOpRange = '\\xac\\xb1\\xd7\\xf7'; |
@@ -265,57 +265,57 @@ discard block |
||
265 | 265 | $rsSpaceRange = ' \\t\\x0b\\f\\xa0\x{feff}\\n\\r\x{2028}\x{2029}\x{1680}\x{180e}\x{2000}\x{2001}\x{2002}\x{2003}\x{2004}\x{2005}\x{2006}\x{2007}\x{2008}\x{2009}\x{200a}\x{202f}\x{205f}\x{3000}'; |
266 | 266 | $rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde'; |
267 | 267 | $rsVarRange = '\x{fe0e}\x{fe0f}'; |
268 | - $rsBreakRange = $rsMathOpRange . $rsNonCharRange . $rsPunctuationRange . $rsSpaceRange; |
|
268 | + $rsBreakRange = $rsMathOpRange.$rsNonCharRange.$rsPunctuationRange.$rsSpaceRange; |
|
269 | 269 | /** Used to compose unicode capture groups. */ |
270 | 270 | $rsApos = "['\x{2019}]"; |
271 | - $rsBreak = '[' . $rsBreakRange . ']'; |
|
272 | - $rsCombo = '[' . $rsComboRange . ']'; |
|
271 | + $rsBreak = '['.$rsBreakRange.']'; |
|
272 | + $rsCombo = '['.$rsComboRange.']'; |
|
273 | 273 | $rsDigits = '\\d+'; |
274 | - $rsDingbat = '[' . $rsDingbatRange . ']'; |
|
275 | - $rsLower = '[' . $rsLowerRange . ']'; |
|
276 | - $rsMisc = '[^' . $rsAstralRange . $rsBreakRange . $rsDigits . $rsDingbatRange . $rsLowerRange . $rsUpperRange . ']'; |
|
274 | + $rsDingbat = '['.$rsDingbatRange.']'; |
|
275 | + $rsLower = '['.$rsLowerRange.']'; |
|
276 | + $rsMisc = '[^'.$rsAstralRange.$rsBreakRange.$rsDigits.$rsDingbatRange.$rsLowerRange.$rsUpperRange.']'; |
|
277 | 277 | $rsFitz = '\\x{e83c}[\x{effb}-\x{efff}]'; |
278 | - $rsModifier = '(?:' . $rsCombo . '|' . $rsFitz . ')'; |
|
279 | - $rsNonAstral = '[^' . $rsAstralRange . ']'; |
|
278 | + $rsModifier = '(?:'.$rsCombo.'|'.$rsFitz.')'; |
|
279 | + $rsNonAstral = '[^'.$rsAstralRange.']'; |
|
280 | 280 | $rsRegional = '(?:\x{e83c}[\x{ede6}-\x{edff}]){2}'; |
281 | 281 | $rsSurrPair = '[\x{e800}-\x{ebff}][\x{ec00}-\x{efff}]'; |
282 | - $rsUpper = '[' . $rsUpperRange . ']'; |
|
282 | + $rsUpper = '['.$rsUpperRange.']'; |
|
283 | 283 | $rsZWJ = '\x{200d}'; |
284 | 284 | /** Used to compose unicode regexes. */ |
285 | - $rsMiscLower = '(?:' . $rsLower . '|' . $rsMisc . ')'; |
|
286 | - $rsMiscUpper = '(?:' . $rsUpper . '|' . $rsMisc . ')'; |
|
287 | - $rsOptContrLower = '(?:' . $rsApos . '(?:d|ll|m|re|s|t|ve))?'; |
|
288 | - $rsOptContrUpper = '(?:' . $rsApos . '(?:D|LL|M|RE|S|T|VE))?'; |
|
289 | - $reOptMod = $rsModifier . '?'; |
|
290 | - $rsOptVar = '[' . $rsVarRange . ']?'; |
|
285 | + $rsMiscLower = '(?:'.$rsLower.'|'.$rsMisc.')'; |
|
286 | + $rsMiscUpper = '(?:'.$rsUpper.'|'.$rsMisc.')'; |
|
287 | + $rsOptContrLower = '(?:'.$rsApos.'(?:d|ll|m|re|s|t|ve))?'; |
|
288 | + $rsOptContrUpper = '(?:'.$rsApos.'(?:D|LL|M|RE|S|T|VE))?'; |
|
289 | + $reOptMod = $rsModifier.'?'; |
|
290 | + $rsOptVar = '['.$rsVarRange.']?'; |
|
291 | 291 | $rsOrdLower = '\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)'; |
292 | 292 | $rsOrdUpper = '\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)'; |
293 | 293 | $asciiWords = '/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/'; |
294 | 294 | $hasUnicodeWordRegex = '/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/'; |
295 | - $rsOptJoin = '(?:' . $rsZWJ . '(?:' . join( |
|
295 | + $rsOptJoin = '(?:'.$rsZWJ.'(?:'.join( |
|
296 | 296 | '|', |
297 | 297 | [$rsNonAstral, $rsRegional, $rsSurrPair] |
298 | - ) . ')' . $rsOptVar . $reOptMod . ')*'; |
|
299 | - $rsSeq = $rsOptVar . $reOptMod . $rsOptJoin; |
|
300 | - $rsEmoji = '(?:' . join('|', [$rsDingbat, $rsRegional, $rsSurrPair]) . ')' . $rsSeq; |
|
298 | + ).')'.$rsOptVar.$reOptMod.')*'; |
|
299 | + $rsSeq = $rsOptVar.$reOptMod.$rsOptJoin; |
|
300 | + $rsEmoji = '(?:'.join('|', [$rsDingbat, $rsRegional, $rsSurrPair]).')'.$rsSeq; |
|
301 | 301 | |
302 | 302 | /** @var string $unicodeWords unicode words patterns to be used in preg_match */ |
303 | - $unicodeWords = '/' . join('|', [ |
|
304 | - $rsUpper . '?' . $rsLower . '+' . $rsOptContrLower . '(?=' . join( |
|
303 | + $unicodeWords = '/'.join('|', [ |
|
304 | + $rsUpper.'?'.$rsLower.'+'.$rsOptContrLower.'(?='.join( |
|
305 | 305 | '|', |
306 | 306 | [$rsBreak, $rsUpper, '$'] |
307 | - ) . ')', |
|
308 | - $rsMiscUpper . '+' . $rsOptContrUpper . '(?=' . join( |
|
307 | + ).')', |
|
308 | + $rsMiscUpper.'+'.$rsOptContrUpper.'(?='.join( |
|
309 | 309 | '|', |
310 | - [$rsBreak, $rsUpper . $rsMiscLower, '$'] |
|
311 | - ) . ')', |
|
312 | - $rsUpper . '?' . $rsMiscLower . '+' . $rsOptContrLower, |
|
313 | - $rsUpper . '+' . $rsOptContrUpper, |
|
310 | + [$rsBreak, $rsUpper.$rsMiscLower, '$'] |
|
311 | + ).')', |
|
312 | + $rsUpper.'?'.$rsMiscLower.'+'.$rsOptContrLower, |
|
313 | + $rsUpper.'+'.$rsOptContrUpper, |
|
314 | 314 | $rsOrdUpper, |
315 | 315 | $rsOrdLower, |
316 | 316 | $rsDigits, |
317 | 317 | $rsEmoji, |
318 | - ]) . '/u'; |
|
318 | + ]).'/u'; |
|
319 | 319 | if ($pattern === null) { |
320 | 320 | $hasUnicodeWord = preg_match($hasUnicodeWordRegex, $input); |
321 | 321 | $pattern = $hasUnicodeWord ? $unicodeWords : $asciiWords; |
@@ -344,10 +344,10 @@ discard block |
||
344 | 344 | |
345 | 345 | return array_reduce( |
346 | 346 | $words, |
347 | - function ($result, $word) use ($words) { |
|
347 | + function($result, $word) use ($words) { |
|
348 | 348 | $isFirst = __::first($words) === $word; |
349 | 349 | |
350 | - return $result . (!$isFirst ? ' ' : '') . __::toLower($word); |
|
350 | + return $result.(!$isFirst ? ' ' : '').__::toLower($word); |
|
351 | 351 | }, |
352 | 352 | '' |
353 | 353 | ); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | public static function slug(string $str, array $options = []): string |
24 | 24 | { |
25 | 25 | // Make sure string is in UTF-8 and strip invalid UTF-8 characters |
26 | - $str = mb_convert_encoding((string)$str, 'UTF-8', mb_list_encodings()); |
|
26 | + $str = mb_convert_encoding((string) $str, 'UTF-8', mb_list_encodings()); |
|
27 | 27 | |
28 | 28 | $defaults = [ |
29 | 29 | 'delimiter' => '-', |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | $str = preg_replace('/[^\p{L}\p{Nd}]+/u', $options['delimiter'], $str); |
349 | 349 | |
350 | 350 | // Remove duplicate delimiters |
351 | - $str = preg_replace('/(' . preg_quote($options['delimiter'], '/') . '){2,}/', '$1', $str); |
|
351 | + $str = preg_replace('/('.preg_quote($options['delimiter'], '/').'){2,}/', '$1', $str); |
|
352 | 352 | |
353 | 353 | // Truncate slug to max. characters |
354 | 354 | $str = mb_substr($str, 0, ($options['limit'] ? $options['limit'] : mb_strlen($str, 'UTF-8')), 'UTF-8'); |
@@ -386,10 +386,10 @@ discard block |
||
386 | 386 | |
387 | 387 | return preg_replace_callback( |
388 | 388 | "&\\b$rexProtocol$rexDomain$rexPort$rexPath$rexQuery$rexFragment(?=[?.!,;:\"]?(\s|$))&", |
389 | - function ($match) { |
|
389 | + function($match) { |
|
390 | 390 | $completeUrl = $match[1] ? $match[0] : "http://{$match[0]}"; |
391 | 391 | |
392 | - return '<a href="' . $completeUrl . '">' . $match[2] . $match[3] . $match[4] . '</a>'; |
|
392 | + return '<a href="'.$completeUrl.'">'.$match[2].$match[3].$match[4].'</a>'; |
|
393 | 393 | }, |
394 | 394 | htmlspecialchars($string) |
395 | 395 | ); |
@@ -411,9 +411,9 @@ discard block |
||
411 | 411 | public static function truncate(string $text, int $limit = 40): string |
412 | 412 | { |
413 | 413 | if (str_word_count($text, 0) > $limit) { |
414 | - $words = (array)str_word_count($text, 2); |
|
414 | + $words = (array) str_word_count($text, 2); |
|
415 | 415 | $pos = array_keys($words); |
416 | - $text = mb_substr($text, 0, $pos[$limit], 'UTF-8') . '...'; |
|
416 | + $text = mb_substr($text, 0, $pos[$limit], 'UTF-8').'...'; |
|
417 | 417 | } |
418 | 418 | |
419 | 419 | return $text; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | { |
134 | 134 | $result = []; |
135 | 135 | |
136 | - __::doForEach($collection, function ($value, $key, $collection) use (&$result, $iterateFn) { |
|
136 | + __::doForEach($collection, function($value, $key, $collection) use (&$result, $iterateFn) { |
|
137 | 137 | $result[] = $iterateFn($value, $key, $collection); |
138 | 138 | }); |
139 | 139 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | */ |
191 | 191 | public static function pluck($collection, string $property): array |
192 | 192 | { |
193 | - $result = array_map(function ($value) use ($property) { |
|
193 | + $result = array_map(function($value) use ($property) { |
|
194 | 194 | if (is_array($value) && isset($value[$property])) { |
195 | 195 | return $value[$property]; |
196 | 196 | } else if (is_object($value) && isset($value->{$property})) { |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | } |
214 | 214 | |
215 | 215 | return $value; |
216 | - }, (array)$collection); |
|
216 | + }, (array) $collection); |
|
217 | 217 | |
218 | 218 | return array_values($result); |
219 | 219 | } |
@@ -284,8 +284,8 @@ discard block |
||
284 | 284 | */ |
285 | 285 | public static function assign($collection1, $collection2) |
286 | 286 | { |
287 | - return __::reduceRight(func_get_args(), function ($source, $result) { |
|
288 | - __::doForEach($source, function ($sourceValue, $key) use (&$result) { |
|
287 | + return __::reduceRight(func_get_args(), function($source, $result) { |
|
288 | + __::doForEach($source, function($sourceValue, $key) use (&$result) { |
|
289 | 289 | $result = __::set($result, $key, $sourceValue); |
290 | 290 | }); |
291 | 291 | |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | |
324 | 324 | __::doForEachRight( |
325 | 325 | $collection, |
326 | - function ($value, $key, $collection) use (&$accumulator, $iterateFn) { |
|
326 | + function($value, $key, $collection) use (&$accumulator, $iterateFn) { |
|
327 | 327 | $accumulator = $iterateFn($accumulator, $value, $key, $collection); |
328 | 328 | } |
329 | 329 | ); |
@@ -441,13 +441,13 @@ discard block |
||
441 | 441 | */ |
442 | 442 | public static function universalSet($collection, $key, $value) |
443 | 443 | { |
444 | - $set_object = function ($object, $key, $value) { |
|
444 | + $set_object = function($object, $key, $value) { |
|
445 | 445 | $newObject = clone $object; |
446 | 446 | $newObject->$key = $value; |
447 | 447 | |
448 | 448 | return $newObject; |
449 | 449 | }; |
450 | - $set_array = function ($array, $key, $value) { |
|
450 | + $set_array = function($array, $key, $value) { |
|
451 | 451 | $array[$key] = $value; |
452 | 452 | |
453 | 453 | return $array; |
@@ -478,10 +478,10 @@ discard block |
||
478 | 478 | } |
479 | 479 | |
480 | 480 | return __::every( |
481 | - __::map($keys, function ($key) use ($collection) { |
|
481 | + __::map($keys, function($key) use ($collection) { |
|
482 | 482 | return __::has($collection, $key); |
483 | 483 | }), |
484 | - function ($v) { |
|
484 | + function($v) { |
|
485 | 485 | return $v === true; |
486 | 486 | } |
487 | 487 | ); |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | $key = $portions[0]; |
510 | 510 | |
511 | 511 | if (count($portions) === 1) { |
512 | - return array_key_exists($key, (array)$collection); |
|
512 | + return array_key_exists($key, (array) $collection); |
|
513 | 513 | } |
514 | 514 | |
515 | 515 | return __::has(__::get($collection, $key), $portions[1]); |
@@ -535,13 +535,13 @@ discard block |
||
535 | 535 | { |
536 | 536 | $isObject = __::isObject($collection1); |
537 | 537 | |
538 | - $args = __::map(func_get_args(), function ($arg) { |
|
539 | - return (array)$arg; |
|
538 | + $args = __::map(func_get_args(), function($arg) { |
|
539 | + return (array) $arg; |
|
540 | 540 | }); |
541 | 541 | |
542 | 542 | $merged = call_user_func_array('array_merge', $args); |
543 | 543 | |
544 | - return $isObject ? (object)$merged : $merged; |
|
544 | + return $isObject ? (object) $merged : $merged; |
|
545 | 545 | } |
546 | 546 | |
547 | 547 | /** |
@@ -563,8 +563,8 @@ discard block |
||
563 | 563 | */ |
564 | 564 | public static function concatDeep($collection1, $collection2) |
565 | 565 | { |
566 | - return __::reduceRight(func_get_args(), function ($source, $result) { |
|
567 | - __::doForEach($source, function ($sourceValue, $key) use (&$result) { |
|
566 | + return __::reduceRight(func_get_args(), function($source, $result) { |
|
567 | + __::doForEach($source, function($sourceValue, $key) use (&$result) { |
|
568 | 568 | if (!__::has($result, $key)) { |
569 | 569 | $result = __::set($result, $key, $sourceValue); |
570 | 570 | } else { |
@@ -573,8 +573,8 @@ discard block |
||
573 | 573 | } else { |
574 | 574 | $resultValue = __::get($result, $key); |
575 | 575 | $result = __::set($result, $key, __::concatDeep( |
576 | - __::isCollection($resultValue) ? $resultValue : (array)$resultValue, |
|
577 | - __::isCollection($sourceValue) ? $sourceValue : (array)$sourceValue |
|
576 | + __::isCollection($resultValue) ? $resultValue : (array) $resultValue, |
|
577 | + __::isCollection($sourceValue) ? $sourceValue : (array) $sourceValue |
|
578 | 578 | )); |
579 | 579 | } |
580 | 580 | } |
@@ -615,9 +615,9 @@ discard block |
||
615 | 615 | { |
616 | 616 | foreach ($array as $index => $value) { |
617 | 617 | if (is_array($value)) { |
618 | - __::internalEase($map, $value, $glue, $prefix . $index . $glue); |
|
618 | + __::internalEase($map, $value, $glue, $prefix.$index.$glue); |
|
619 | 619 | } else { |
620 | - $map[$prefix . $index] = $value; |
|
620 | + $map[$prefix.$index] = $value; |
|
621 | 621 | } |
622 | 622 | } |
623 | 623 | } |
@@ -642,7 +642,7 @@ discard block |
||
642 | 642 | |
643 | 643 | __::doForEach( |
644 | 644 | $collection, |
645 | - function ($value, $key, $collection) use (&$truthy, $iterateFn) { |
|
645 | + function($value, $key, $collection) use (&$truthy, $iterateFn) { |
|
646 | 646 | $truthy = $truthy && $iterateFn($value, $key, $collection); |
647 | 647 | if (!$truthy) { |
648 | 648 | return false; |
@@ -709,7 +709,7 @@ discard block |
||
709 | 709 | $groupKey = null; |
710 | 710 | if (is_callable($key)) { |
711 | 711 | $groupKey = call_user_func($key, $value); |
712 | - } else if (is_object($value) && property_exists($value, (string)$key)) { |
|
712 | + } else if (is_object($value) && property_exists($value, (string) $key)) { |
|
713 | 713 | $groupKey = $value->{$key}; |
714 | 714 | } else if (is_array($value) && isset($value[$key])) { |
715 | 715 | $groupKey = $value[$key]; |
@@ -742,7 +742,7 @@ discard block |
||
742 | 742 | */ |
743 | 743 | public static function isEmpty($value): bool |
744 | 744 | { |
745 | - return (!__::isArray($value) && !__::isObject($value)) || count((array)$value) === 0; |
|
745 | + return (!__::isArray($value) && !__::isObject($value)) || count((array) $value) === 0; |
|
746 | 746 | } |
747 | 747 | |
748 | 748 | /** |
@@ -813,8 +813,8 @@ discard block |
||
813 | 813 | */ |
814 | 814 | public static function merge($collection1, $collection2) |
815 | 815 | { |
816 | - return __::reduceRight(func_get_args(), function ($source, $result) { |
|
817 | - __::doForEach($source, function ($sourceValue, $key) use (&$result) { |
|
816 | + return __::reduceRight(func_get_args(), function($source, $result) { |
|
817 | + __::doForEach($source, function($sourceValue, $key) use (&$result) { |
|
818 | 818 | $value = $sourceValue; |
819 | 819 | if (__::isCollection($value)) { |
820 | 820 | $value = __::merge(__::get($result, $key), $sourceValue); |
@@ -841,7 +841,7 @@ discard block |
||
841 | 841 | */ |
842 | 842 | public static function pick($collection = [], array $paths = [], $default = null) |
843 | 843 | { |
844 | - return __::reduce($paths, function ($results, $path) use ($collection, $default) { |
|
844 | + return __::reduce($paths, function($results, $path) use ($collection, $default) { |
|
845 | 845 | return __::set($results, $path, __::get($collection, $path, $default)); |
846 | 846 | }, __::isObject($collection) ? new stdClass() : []); |
847 | 847 | } |
@@ -912,7 +912,7 @@ discard block |
||
912 | 912 | } |
913 | 913 | __::doForEach( |
914 | 914 | $collection, |
915 | - function ($value, $key, $collection) use (&$accumulator, $iterateFn) { |
|
915 | + function($value, $key, $collection) use (&$accumulator, $iterateFn) { |
|
916 | 916 | $accumulator = $iterateFn($accumulator, $value, $key, $collection); |
917 | 917 | } |
918 | 918 | ); |
@@ -33,7 +33,7 @@ |
||
33 | 33 | */ |
34 | 34 | public function __call(string $functionName, array $params): self |
35 | 35 | { |
36 | - if (is_callable('\__::' . $functionName, true)) { |
|
36 | + if (is_callable('\__::'.$functionName, true)) { |
|
37 | 37 | $params = $params == null ? [] : $params; |
38 | 38 | $params = __::prepend($params, $this->value); |
39 | 39 | /** @var callable $fnCallable */ |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | public static function patch(array $array, array $patches, string $parent = ''): array |
124 | 124 | { |
125 | 125 | foreach ($array as $key => $value) { |
126 | - $z = $parent . '/' . $key; |
|
126 | + $z = $parent.'/'.$key; |
|
127 | 127 | |
128 | 128 | if (isset($patches[$z])) { |
129 | 129 | $array[$key] = $patches[$z]; |
@@ -334,8 +334,8 @@ discard block |
||
334 | 334 | */ |
335 | 335 | public static function clean(array $array) |
336 | 336 | { |
337 | - return __::filter($array, function ($value) { |
|
338 | - return (bool)$value; |
|
337 | + return __::filter($array, function($value) { |
|
338 | + return (bool) $value; |
|
339 | 339 | }); |
340 | 340 | } |
341 | 341 | |
@@ -374,8 +374,8 @@ discard block |
||
374 | 374 | */ |
375 | 375 | public static function intersection(array $a, array $b): array |
376 | 376 | { |
377 | - $a = (array)$a; |
|
378 | - $b = (array)$b; |
|
377 | + $a = (array) $a; |
|
378 | + $b = (array) $b; |
|
379 | 379 | |
380 | 380 | return array_values(array_intersect($a, $b)); |
381 | 381 | } |
@@ -393,8 +393,8 @@ discard block |
||
393 | 393 | */ |
394 | 394 | public static function intersects(array $a, array $b): bool |
395 | 395 | { |
396 | - $a = (array)$a; |
|
397 | - $b = (array)$b; |
|
396 | + $a = (array) $a; |
|
397 | + $b = (array) $b; |
|
398 | 398 | |
399 | 399 | return count(self::intersection($a, $b)) > 0; |
400 | 400 | } |