@@ -101,10 +101,10 @@ |
||
| 101 | 101 | $event['event'] = $aliases[$event['event']] ?? $event['event']; |
| 102 | 102 | |
| 103 | 103 | if (!isset($event['method'])) { |
| 104 | - $event['method'] = 'on'.preg_replace_callback([ |
|
| 104 | + $event['method'] = 'on' . preg_replace_callback([ |
|
| 105 | 105 | '/(?<=\b)[a-z]/i', |
| 106 | 106 | '/[^a-z0-9]/i', |
| 107 | - ], function ($matches) { return strtoupper($matches[0]); }, $event['event']); |
|
| 107 | + ], function($matches) { return strtoupper($matches[0]); }, $event['event']); |
|
| 108 | 108 | $event['method'] = preg_replace('/[^a-z0-9]/i', '', $event['method']); |
| 109 | 109 | |
| 110 | 110 | if (null !== ($class = $container->getDefinition($id)->getClass()) && ($r = $container->getReflectionClass($class, false)) && !$r->hasMethod($event['method']) && $r->hasMethod('__invoke')) { |
@@ -27,9 +27,9 @@ discard block |
||
| 27 | 27 | public function testHas() |
| 28 | 28 | { |
| 29 | 29 | $locator = $this->getServiceLocator([ |
| 30 | - 'foo' => function () { return 'bar'; }, |
|
| 31 | - 'bar' => function () { return 'baz'; }, |
|
| 32 | - function () { return 'dummy'; }, |
|
| 30 | + 'foo' => function() { return 'bar'; }, |
|
| 31 | + 'bar' => function() { return 'baz'; }, |
|
| 32 | + function() { return 'dummy'; }, |
|
| 33 | 33 | ]); |
| 34 | 34 | |
| 35 | 35 | $this->assertTrue($locator->has('foo')); |
@@ -40,8 +40,8 @@ discard block |
||
| 40 | 40 | public function testGet() |
| 41 | 41 | { |
| 42 | 42 | $locator = $this->getServiceLocator([ |
| 43 | - 'foo' => function () { return 'bar'; }, |
|
| 44 | - 'bar' => function () { return 'baz'; }, |
|
| 43 | + 'foo' => function() { return 'bar'; }, |
|
| 44 | + 'bar' => function() { return 'baz'; }, |
|
| 45 | 45 | ]); |
| 46 | 46 | |
| 47 | 47 | $this->assertSame('bar', $locator->get('foo')); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | { |
| 53 | 53 | $i = 0; |
| 54 | 54 | $locator = $this->getServiceLocator([ |
| 55 | - 'foo' => function () use (&$i) { |
|
| 55 | + 'foo' => function() use (&$i) { |
|
| 56 | 56 | ++$i; |
| 57 | 57 | |
| 58 | 58 | return 'bar'; |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $this->expectExceptionMessage('The service "foo" has a dependency on a non-existent service "bar". This locator only knows about the "foo" service.'); |
| 72 | 72 | } |
| 73 | 73 | $locator = $this->getServiceLocator([ |
| 74 | - 'foo' => function () use (&$locator) { return $locator->get('bar'); }, |
|
| 74 | + 'foo' => function() use (&$locator) { return $locator->get('bar'); }, |
|
| 75 | 75 | ]); |
| 76 | 76 | |
| 77 | 77 | $locator->get('foo'); |
@@ -82,9 +82,9 @@ discard block |
||
| 82 | 82 | $this->expectException(\Psr\Container\ContainerExceptionInterface::class); |
| 83 | 83 | $this->expectExceptionMessage('Circular reference detected for service "bar", path: "bar -> baz -> bar".'); |
| 84 | 84 | $locator = $this->getServiceLocator([ |
| 85 | - 'foo' => function () use (&$locator) { return $locator->get('bar'); }, |
|
| 86 | - 'bar' => function () use (&$locator) { return $locator->get('baz'); }, |
|
| 87 | - 'baz' => function () use (&$locator) { return $locator->get('bar'); }, |
|
| 85 | + 'foo' => function() use (&$locator) { return $locator->get('bar'); }, |
|
| 86 | + 'bar' => function() use (&$locator) { return $locator->get('baz'); }, |
|
| 87 | + 'baz' => function() use (&$locator) { return $locator->get('bar'); }, |
|
| 88 | 88 | ]); |
| 89 | 89 | |
| 90 | 90 | $locator->get('foo'); |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | } else { |
| 90 | 90 | $type = (new \ReflectionFunction($factory))->getReturnType(); |
| 91 | 91 | |
| 92 | - $this->providedTypes[$name] = $type ? ($type->allowsNull() ? '?' : '').($type instanceof \ReflectionNamedType ? $type->getName() : $type) : '?'; |
|
| 92 | + $this->providedTypes[$name] = $type ? ($type->allowsNull() ? '?' : '') . ($type instanceof \ReflectionNamedType ? $type->getName() : $type) : '?'; |
|
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | } |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | if (self::class === $method->getDeclaringClass()->name && ($returnType = $method->getReturnType()) && !$returnType->isBuiltin()) { |
| 46 | - $services[self::class.'::'.$method->name] = '?'.($returnType instanceof \ReflectionNamedType ? $returnType->getName() : $returnType); |
|
| 46 | + $services[self::class . '::' . $method->name] = '?' . ($returnType instanceof \ReflectionNamedType ? $returnType->getName() : $returnType); |
|
| 47 | 47 | } |
| 48 | 48 | } |
| 49 | 49 | |
@@ -29,8 +29,8 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | public function __construct($start, $end, bool $morePrecision = false) |
| 31 | 31 | { |
| 32 | - $this->start = $morePrecision ? (float) $start : (int) $start; |
|
| 33 | - $this->end = $morePrecision ? (float) $end : (int) $end; |
|
| 32 | + $this->start = $morePrecision ? (float)$start : (int)$start; |
|
| 33 | + $this->end = $morePrecision ? (float)$end : (int)$end; |
|
| 34 | 34 | $this->memory = memory_get_usage(true); |
| 35 | 35 | } |
| 36 | 36 | |
@@ -176,7 +176,7 @@ |
||
| 176 | 176 | $stream = fopen('php://memory', 'r+', false); |
| 177 | 177 | |
| 178 | 178 | foreach ($inputs as $input) { |
| 179 | - fwrite($stream, $input.\PHP_EOL); |
|
| 179 | + fwrite($stream, $input . \PHP_EOL); |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | rewind($stream); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $this->bufferedOutput = new TrimmedBufferOutput(\DIRECTORY_SEPARATOR === '\\' ? 4 : 2, $output->getVerbosity(), false, clone $output->getFormatter()); |
| 50 | 50 | // Windows cmd wraps lines as soon as the terminal width is reached, whether there are following chars or not. |
| 51 | 51 | $width = (new Terminal())->getWidth() ?: self::MAX_LINE_LENGTH; |
| 52 | - $this->lineLength = min($width - (int) (\DIRECTORY_SEPARATOR === '\\'), self::MAX_LINE_LENGTH); |
|
| 52 | + $this->lineLength = min($width - (int)(\DIRECTORY_SEPARATOR === '\\'), self::MAX_LINE_LENGTH); |
|
| 53 | 53 | |
| 54 | 54 | parent::__construct($output); |
| 55 | 55 | } |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | public function listing(array $elements) |
| 101 | 101 | { |
| 102 | 102 | $this->autoPrependText(); |
| 103 | - $elements = array_map(function ($element) { |
|
| 103 | + $elements = array_map(function($element) { |
|
| 104 | 104 | return sprintf(' * %s', $element); |
| 105 | 105 | }, $elements); |
| 106 | 106 | |
@@ -497,10 +497,10 @@ discard block |
||
| 497 | 497 | |
| 498 | 498 | foreach ($lines as $i => &$line) { |
| 499 | 499 | if (null !== $type) { |
| 500 | - $line = $firstLineIndex === $i ? $type.$line : $lineIndentation.$line; |
|
| 500 | + $line = $firstLineIndex === $i ? $type . $line : $lineIndentation . $line; |
|
| 501 | 501 | } |
| 502 | 502 | |
| 503 | - $line = $prefix.$line; |
|
| 503 | + $line = $prefix . $line; |
|
| 504 | 504 | $line .= str_repeat(' ', max($this->lineLength - Helper::width(Helper::removeDecoration($this->getFormatter(), $line)), 0)); |
| 505 | 505 | |
| 506 | 506 | if ($style) { |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | } |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | - return is_numeric($statusCode) ? (int) $statusCode : 0; |
|
| 295 | + return is_numeric($statusCode) ? (int)$statusCode : 0; |
|
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | /** |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | if ($code instanceof \Closure) { |
| 315 | 315 | $r = new \ReflectionFunction($code); |
| 316 | 316 | if (null === $r->getClosureThis()) { |
| 317 | - set_error_handler(static function () {}); |
|
| 317 | + set_error_handler(static function() {}); |
|
| 318 | 318 | try { |
| 319 | 319 | if ($c = \Closure::bind($code, $this)) { |
| 320 | 320 | $code = $c; |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | ]; |
| 578 | 578 | $replacements = [ |
| 579 | 579 | $name, |
| 580 | - $isSingleCommand ? $_SERVER['PHP_SELF'] : $_SERVER['PHP_SELF'].' '.$name, |
|
| 580 | + $isSingleCommand ? $_SERVER['PHP_SELF'] : $_SERVER['PHP_SELF'] . ' ' . $name, |
|
| 581 | 581 | ]; |
| 582 | 582 | |
| 583 | 583 | return str_replace($placeholders, $replacements, $this->getHelp() ?: $this->getDescription()); |
@@ -96,7 +96,7 @@ |
||
| 96 | 96 | { |
| 97 | 97 | if (null === $this->handlesHrefGracefully) { |
| 98 | 98 | $this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') |
| 99 | - && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100); |
|
| 99 | + && (!getenv('KONSOLE_VERSION') || (int)getenv('KONSOLE_VERSION') > 201100); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | if (null !== $this->href && $this->handlesHrefGracefully) { |