@@ -73,7 +73,7 @@ |
||
73 | 73 | */ |
74 | 74 | public function getContents() |
75 | 75 | { |
76 | - set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; }); |
|
76 | + set_error_handler(function($type, $msg) use (&$error) { $error = $msg; }); |
|
77 | 77 | $content = file_get_contents($this->getPathname()); |
78 | 78 | restore_error_handler(); |
79 | 79 | if (false === $content) { |
@@ -30,15 +30,15 @@ |
||
30 | 30 | $gitignoreLines = array_map('trim', $gitignoreLines); |
31 | 31 | $gitignoreLines = array_filter($gitignoreLines); |
32 | 32 | |
33 | - $ignoreLinesPositive = array_filter($gitignoreLines, function (string $line) { |
|
33 | + $ignoreLinesPositive = array_filter($gitignoreLines, function(string $line) { |
|
34 | 34 | return !preg_match('/^!/', $line); |
35 | 35 | }); |
36 | 36 | |
37 | - $ignoreLinesNegative = array_filter($gitignoreLines, function (string $line) { |
|
37 | + $ignoreLinesNegative = array_filter($gitignoreLines, function(string $line) { |
|
38 | 38 | return preg_match('/^!/', $line); |
39 | 39 | }); |
40 | 40 | |
41 | - $ignoreLinesNegative = array_map(function (string $line) { |
|
41 | + $ignoreLinesNegative = array_map(function(string $line) { |
|
42 | 42 | return preg_replace('/^!(.*)/', '${1}', $line); |
43 | 43 | }, $ignoreLinesNegative); |
44 | 44 | $ignoreLinesNegative = array_map([__CLASS__, 'getRegexFromGitignore'], $ignoreLinesNegative); |
@@ -262,7 +262,7 @@ |
||
262 | 262 | foreach ($listeners as &$listener) { |
263 | 263 | $closure = &$this->optimized[$eventName][]; |
264 | 264 | if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) { |
265 | - $closure = static function (...$args) use (&$listener, &$closure) { |
|
265 | + $closure = static function(...$args) use (&$listener, &$closure) { |
|
266 | 266 | if ($listener[0] instanceof \Closure) { |
267 | 267 | $listener[0] = $listener[0](); |
268 | 268 | $listener[1] = $listener[1] ?? '__invoke'; |
@@ -83,7 +83,7 @@ |
||
83 | 83 | $event['method'] = 'on'.preg_replace_callback([ |
84 | 84 | '/(?<=\b)[a-z]/i', |
85 | 85 | '/[^a-z0-9]/i', |
86 | - ], function ($matches) { return strtoupper($matches[0]); }, $event['event']); |
|
86 | + ], function($matches) { return strtoupper($matches[0]); }, $event['event']); |
|
87 | 87 | $event['method'] = preg_replace('/[^a-z0-9]/i', '', $event['method']); |
88 | 88 | |
89 | 89 | if (null !== ($class = $container->getDefinition($id)->getClass()) && ($r = $container->getReflectionClass($class, false)) && !$r->hasMethod($event['method']) && $r->hasMethod('__invoke')) { |
@@ -53,7 +53,7 @@ |
||
53 | 53 | { |
54 | 54 | static $handler; |
55 | 55 | if (!$handler) { |
56 | - $handler = function () { return false; }; |
|
56 | + $handler = function() { return false; }; |
|
57 | 57 | } |
58 | 58 | set_error_handler($handler); |
59 | 59 | @trigger_error(''); |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | $startPath = str_replace('\\', '/', $startPath); |
435 | 435 | } |
436 | 436 | |
437 | - $stripDriveLetter = function ($path) { |
|
437 | + $stripDriveLetter = function($path) { |
|
438 | 438 | if (\strlen($path) > 2 && ':' === $path[1] && '/' === $path[2] && ctype_alpha($path[0])) { |
439 | 439 | return substr($path, 2); |
440 | 440 | } |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | $startPathArr = explode('/', trim($startPath, '/')); |
450 | 450 | $endPathArr = explode('/', trim($endPath, '/')); |
451 | 451 | |
452 | - $normalizePathArray = function ($pathSegments) { |
|
452 | + $normalizePathArray = function($pathSegments) { |
|
453 | 453 | $result = []; |
454 | 454 | |
455 | 455 | foreach ($pathSegments as $segment) { |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $output = new ConsoleOutput(); |
120 | 120 | } |
121 | 121 | |
122 | - $renderException = function (\Throwable $e) use ($output) { |
|
122 | + $renderException = function(\Throwable $e) use ($output) { |
|
123 | 123 | if ($output instanceof ConsoleOutputInterface) { |
124 | 124 | $this->renderThrowable($e, $output->getErrorOutput()); |
125 | 125 | } else { |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | public function findNamespace(string $namespace) |
557 | 557 | { |
558 | 558 | $allNamespaces = $this->getNamespaces(); |
559 | - $expr = preg_replace_callback('{([^:]+|)}', function ($matches) { return preg_quote($matches[1]).'[^:]*'; }, $namespace); |
|
559 | + $expr = preg_replace_callback('{([^:]+|)}', function($matches) { return preg_quote($matches[1]).'[^:]*'; }, $namespace); |
|
560 | 560 | $namespaces = preg_grep('{^'.$expr.'}', $allNamespaces); |
561 | 561 | |
562 | 562 | if (empty($namespaces)) { |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | } |
613 | 613 | |
614 | 614 | $allCommands = $this->commandLoader ? array_merge($this->commandLoader->getNames(), array_keys($this->commands)) : array_keys($this->commands); |
615 | - $expr = preg_replace_callback('{([^:]+|)}', function ($matches) { return preg_quote($matches[1]).'[^:]*'; }, $name); |
|
615 | + $expr = preg_replace_callback('{([^:]+|)}', function($matches) { return preg_quote($matches[1]).'[^:]*'; }, $name); |
|
616 | 616 | $commands = preg_grep('{^'.$expr.'}', $allCommands); |
617 | 617 | |
618 | 618 | if (empty($commands)) { |
@@ -630,7 +630,7 @@ discard block |
||
630 | 630 | |
631 | 631 | if ($alternatives = $this->findAlternatives($name, $allCommands)) { |
632 | 632 | // remove hidden commands |
633 | - $alternatives = array_filter($alternatives, function ($name) { |
|
633 | + $alternatives = array_filter($alternatives, function($name) { |
|
634 | 634 | return !$this->get($name)->isHidden(); |
635 | 635 | }); |
636 | 636 | |
@@ -648,7 +648,7 @@ discard block |
||
648 | 648 | // filter out aliases for commands which are already on the list |
649 | 649 | if (\count($commands) > 1) { |
650 | 650 | $commandList = $this->commandLoader ? array_merge(array_flip($this->commandLoader->getNames()), $this->commands) : $this->commands; |
651 | - $commands = array_unique(array_filter($commands, function ($nameOrAlias) use (&$commandList, $commands, &$aliases) { |
|
651 | + $commands = array_unique(array_filter($commands, function($nameOrAlias) use (&$commandList, $commands, &$aliases) { |
|
652 | 652 | if (!$commandList[$nameOrAlias] instanceof Command) { |
653 | 653 | $commandList[$nameOrAlias] = $this->commandLoader->get($nameOrAlias); |
654 | 654 | } |
@@ -668,7 +668,7 @@ discard block |
||
668 | 668 | foreach ($abbrevs as $abbrev) { |
669 | 669 | $maxLen = max(Helper::strlen($abbrev), $maxLen); |
670 | 670 | } |
671 | - $abbrevs = array_map(function ($cmd) use ($commandList, $usableWidth, $maxLen, &$commands) { |
|
671 | + $abbrevs = array_map(function($cmd) use ($commandList, $usableWidth, $maxLen, &$commands) { |
|
672 | 672 | if ($commandList[$cmd]->isHidden()) { |
673 | 673 | unset($commands[array_search($cmd, $commands)]); |
674 | 674 | |
@@ -784,7 +784,7 @@ discard block |
||
784 | 784 | } |
785 | 785 | |
786 | 786 | if (false !== strpos($message, "class@anonymous\0")) { |
787 | - $message = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { |
|
787 | + $message = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function($m) { |
|
788 | 788 | return class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0]; |
789 | 789 | }, $message); |
790 | 790 | } |
@@ -1083,7 +1083,7 @@ discard block |
||
1083 | 1083 | } |
1084 | 1084 | } |
1085 | 1085 | |
1086 | - $alternatives = array_filter($alternatives, function ($lev) use ($threshold) { return $lev < 2 * $threshold; }); |
|
1086 | + $alternatives = array_filter($alternatives, function($lev) use ($threshold) { return $lev < 2 * $threshold; }); |
|
1087 | 1087 | ksort($alternatives, SORT_NATURAL | SORT_FLAG_CASE); |
1088 | 1088 | |
1089 | 1089 | return array_keys($alternatives); |
@@ -68,7 +68,7 @@ |
||
68 | 68 | $definition = $this->definition; |
69 | 69 | $givenArguments = $this->arguments; |
70 | 70 | |
71 | - $missingArguments = array_filter(array_keys($definition->getArguments()), function ($argument) use ($definition, $givenArguments) { |
|
71 | + $missingArguments = array_filter(array_keys($definition->getArguments()), function($argument) use ($definition, $givenArguments) { |
|
72 | 72 | return !\array_key_exists($argument, $givenArguments) && $definition->getArgument($argument)->isRequired(); |
73 | 73 | }); |
74 | 74 |
@@ -332,7 +332,7 @@ |
||
332 | 332 | */ |
333 | 333 | public function __toString() |
334 | 334 | { |
335 | - $tokens = array_map(function ($token) { |
|
335 | + $tokens = array_map(function($token) { |
|
336 | 336 | if (preg_match('{^(-[^=]+=)(.+)}', $token, $match)) { |
337 | 337 | return $match[1].$this->escapeToken($match[2]); |
338 | 338 | } |