@@ -43,13 +43,13 @@ discard block |
||
| 43 | 43 | ->getReflectionConstants() |
| 44 | 44 | ; |
| 45 | 45 | |
| 46 | - foreach ($constants as $reflection) { |
|
| 47 | - if ($reflection->getName() === $name) { |
|
| 46 | + foreach ($constants as $reflection){ |
|
| 47 | + if ($reflection->getName() === $name){ |
|
| 48 | 48 | return $reflection; |
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - throw new \ReflectionException('Constant ' . $name . ' not found'); |
|
| 52 | + throw new \ReflectionException('Constant '.$name.' not found'); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | protected function getReflectionFunctionParameter(string $function, string $name): \ReflectionParameter |
@@ -58,13 +58,13 @@ discard block |
||
| 58 | 58 | ->getParameters() |
| 59 | 59 | ; |
| 60 | 60 | |
| 61 | - foreach ($parameters as $reflection) { |
|
| 62 | - if ($reflection->getName() === $name) { |
|
| 61 | + foreach ($parameters as $reflection){ |
|
| 62 | + if ($reflection->getName() === $name){ |
|
| 63 | 63 | return $reflection; |
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - throw new \ReflectionException('Parameter ' . $name . ' not found'); |
|
| 67 | + throw new \ReflectionException('Parameter '.$name.' not found'); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | protected function getReflectionMethodParameter(string $class, string $method, string $name): \ReflectionParameter |
@@ -73,12 +73,12 @@ discard block |
||
| 73 | 73 | ->getParameters() |
| 74 | 74 | ; |
| 75 | 75 | |
| 76 | - foreach ($parameters as $reflection) { |
|
| 77 | - if ($reflection->getName() === $name) { |
|
| 76 | + foreach ($parameters as $reflection){ |
|
| 77 | + if ($reflection->getName() === $name){ |
|
| 78 | 78 | return $reflection; |
| 79 | 79 | } |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - throw new \ReflectionException('Parameter ' . $name . ' not found'); |
|
| 82 | + throw new \ReflectionException('Parameter '.$name.' not found'); |
|
| 83 | 83 | } |
| 84 | 84 | } |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | protected function each(callable $resolver): iterable |
| 20 | 20 | { |
| 21 | - foreach ($this->readers as $reader) { |
|
| 21 | + foreach ($this->readers as $reader){ |
|
| 22 | 22 | yield from $resolver($reader); |
| 23 | 23 | } |
| 24 | 24 | } |
@@ -18,10 +18,10 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | protected function each(callable $resolver): iterable |
| 20 | 20 | { |
| 21 | - foreach ($this->readers as $reader) { |
|
| 21 | + foreach ($this->readers as $reader){ |
|
| 22 | 22 | $result = $this->iterableToArray($resolver($reader)); |
| 23 | 23 | |
| 24 | - if (\count($result) > 0) { |
|
| 24 | + if (\count($result) > 0){ |
|
| 25 | 25 | return $result; |
| 26 | 26 | } |
| 27 | 27 | } |
@@ -24,15 +24,15 @@ discard block |
||
| 24 | 24 | */ |
| 25 | 25 | protected function getConstructor(\ReflectionClass $class): ?\ReflectionMethod |
| 26 | 26 | { |
| 27 | - if ($class->hasMethod(self::CONSTRUCTOR_NAME)) { |
|
| 27 | + if ($class->hasMethod(self::CONSTRUCTOR_NAME)){ |
|
| 28 | 28 | return $class->getMethod(self::CONSTRUCTOR_NAME); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - if ($constructor = $this->getTraitConstructors($class)) { |
|
| 31 | + if ($constructor = $this->getTraitConstructors($class)){ |
|
| 32 | 32 | return $constructor; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - if ($parent = $class->getParentClass()) { |
|
| 35 | + if ($parent = $class->getParentClass()){ |
|
| 36 | 36 | return $this->getConstructor($parent); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -45,12 +45,12 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | private function getTraitConstructors(\ReflectionClass $class): ?\ReflectionMethod |
| 47 | 47 | { |
| 48 | - foreach ($class->getTraits() as $trait) { |
|
| 49 | - if ($constructor = $this->getConstructor($trait)) { |
|
| 48 | + foreach ($class->getTraits() as $trait){ |
|
| 49 | + if ($constructor = $this->getConstructor($trait)){ |
|
| 50 | 50 | return $constructor; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - if ($constructor = $this->getTraitConstructors($trait)) { |
|
| 53 | + if ($constructor = $this->getTraitConstructors($trait)){ |
|
| 54 | 54 | return $constructor; |
| 55 | 55 | } |
| 56 | 56 | } |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * @var string |
| 31 | 31 | */ |
| 32 | 32 | private const ERROR_INVALID_PROPERTY = |
| 33 | - 'The attribute #[%s] declared on %s does not have a property named "%s".' . "\n" . |
|
| 33 | + 'The attribute #[%s] declared on %s does not have a property named "%s".'."\n". |
|
| 34 | 34 | 'Available properties: %s' |
| 35 | 35 | ; |
| 36 | 36 | |
@@ -61,23 +61,23 @@ discard block |
||
| 61 | 61 | $arguments = $this->formatArguments($arguments); |
| 62 | 62 | |
| 63 | 63 | // Using constructor |
| 64 | - if ($this->getConstructor($attr)) { |
|
| 64 | + if ($this->getConstructor($attr)){ |
|
| 65 | 65 | return $attr->newInstance($arguments); |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | // Using direct insert |
| 69 | 69 | $instance = $attr->newInstanceWithoutConstructor(); |
| 70 | 70 | |
| 71 | - foreach ($arguments as $name => $value) { |
|
| 72 | - try { |
|
| 71 | + foreach ($arguments as $name => $value){ |
|
| 72 | + try{ |
|
| 73 | 73 | $property = $attr->getProperty($name); |
| 74 | 74 | |
| 75 | - if (!$property->isPublic()) { |
|
| 75 | + if (!$property->isPublic()){ |
|
| 76 | 76 | throw $this->propertyNotFound($attr, $name, $context); |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | $instance->$name = $value; |
| 80 | - } catch (\Throwable $e) { |
|
| 80 | + }catch (\Throwable $e){ |
|
| 81 | 81 | throw $this->propertyNotFound($attr, $name, $context); |
| 82 | 82 | } |
| 83 | 83 | } |
@@ -93,8 +93,8 @@ discard block |
||
| 93 | 93 | { |
| 94 | 94 | $result = []; |
| 95 | 95 | |
| 96 | - foreach ($arguments as $name => $value) { |
|
| 97 | - if (\is_int($name)) { |
|
| 96 | + foreach ($arguments as $name => $value){ |
|
| 97 | + if (\is_int($name)){ |
|
| 98 | 98 | $this->validateArgumentPosition($name, $value); |
| 99 | 99 | |
| 100 | 100 | $name = self::DEFAULT_PROPERTY_NAME; |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | private function validateArgumentPosition(int $index, $value): void |
| 114 | 114 | { |
| 115 | - if ($index === 0) { |
|
| 115 | + if ($index === 0){ |
|
| 116 | 116 | return; |
| 117 | 117 | } |
| 118 | 118 | |
@@ -26,14 +26,14 @@ |
||
| 26 | 26 | public function setUp(): void |
| 27 | 27 | { |
| 28 | 28 | $this->app = App::init([ |
| 29 | - 'root' => __DIR__ . '/App', |
|
| 30 | - 'app' => __DIR__ . '/App' |
|
| 29 | + 'root' => __DIR__.'/App', |
|
| 30 | + 'app' => __DIR__.'/App' |
|
| 31 | 31 | ]); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | public function tearDown(): void |
| 35 | 35 | { |
| 36 | - foreach (glob(__DIR__ . '/App/runtime/cache/views/*.php') as $file) { |
|
| 36 | + foreach (glob(__DIR__.'/App/runtime/cache/views/*.php') as $file){ |
|
| 37 | 37 | @unlink($file); |
| 38 | 38 | } |
| 39 | 39 | } |
@@ -28,11 +28,11 @@ |
||
| 28 | 28 | $container->bindSingleton(ReaderInterface::class, function () use ($container) { |
| 29 | 29 | $factory = new Factory(); |
| 30 | 30 | |
| 31 | - if ($container->has(CacheInterface::class)) { |
|
| 31 | + if ($container->has(CacheInterface::class)){ |
|
| 32 | 32 | $factory = $factory->withCache( |
| 33 | 33 | $container->get(CacheInterface::class) |
| 34 | 34 | ); |
| 35 | - } elseif ($container->has(CacheItemInterface::class)) { |
|
| 35 | + } elseif ($container->has(CacheItemInterface::class)){ |
|
| 36 | 36 | $factory = $factory->withCache( |
| 37 | 37 | $container->get(CacheItemInterface::class) |
| 38 | 38 | ); |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | public function testCache(): void |
| 26 | 26 | { |
| 27 | - $cache = __DIR__ . '/App/runtime/cache/routes.php'; |
|
| 27 | + $cache = __DIR__.'/App/runtime/cache/routes.php'; |
|
| 28 | 28 | $this->assertFileExists($cache); |
| 29 | 29 | |
| 30 | 30 | $this->assertIsIterable($this->include($cache)); |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | private function include(string $file) |
| 45 | 45 | { |
| 46 | 46 | // Required when "opcache.cli_enabled=1" |
| 47 | - if (\function_exists('\\opcache_invalidate')) { |
|
| 47 | + if (\function_exists('\\opcache_invalidate')){ |
|
| 48 | 48 | \opcache_invalidate($file); |
| 49 | 49 | } |
| 50 | 50 | |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor; |
| 15 | 15 | |
| 16 | - if (!\interface_exists(NamedArgumentConstructorAnnotation::class)) { |
|
| 16 | + if (!\interface_exists(NamedArgumentConstructorAnnotation::class)){ |
|
| 17 | 17 | /** |
| 18 | 18 | * Marker interface for PHP7/PHP8 compatible support for named |
| 19 | 19 | * arguments (and constructor property promotion). |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | namespace Doctrine\Common\Annotations\Annotation { |
| 32 | 32 | |
| 33 | - if (!\class_exists(NamedArgumentConstructor::class, false)) { |
|
| 33 | + if (!\class_exists(NamedArgumentConstructor::class, false)){ |
|
| 34 | 34 | /** |
| 35 | 35 | * Annotation that indicates that the annotated class should be |
| 36 | 36 | * constructed with a named argument call. |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | use JetBrains\PhpStorm\ExpectedValues; |
| 52 | 52 | |
| 53 | - if (!\class_exists(Attribute::class, false)) { |
|
| 53 | + if (!\class_exists(Attribute::class, false)){ |
|
| 54 | 54 | /** |
| 55 | 55 | * @psalm-type AttributeTarget = Attribute::TARGET_* |
| 56 | 56 | * @psalm-type AttributeFlag = AttributeTarget | Attribute::IS_REPEATABLE |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | public function __construct( |
| 134 | 134 | #[ExpectedValues(flagsFromClass: Attribute::class)] |
| 135 | 135 | int $flags = self::TARGET_ALL |
| 136 | - ) { |
|
| 136 | + ){ |
|
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | 139 | } |