@@ -30,62 +30,62 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | return RectorConfig::configure() |
| 32 | 32 | ->withPaths([ |
| 33 | - __DIR__ . '/src/*/src', |
|
| 34 | - __DIR__ . '/src/*/*/src', |
|
| 35 | - __DIR__ . '/src/*/*/tests', |
|
| 36 | - __DIR__ . '/src/*/tests', |
|
| 37 | - __DIR__ . '/tests', |
|
| 33 | + __DIR__.'/src/*/src', |
|
| 34 | + __DIR__.'/src/*/*/src', |
|
| 35 | + __DIR__.'/src/*/*/tests', |
|
| 36 | + __DIR__.'/src/*/tests', |
|
| 37 | + __DIR__.'/tests', |
|
| 38 | 38 | ]) |
| 39 | 39 | ->withParallel() |
| 40 | 40 | ->withSkip([ |
| 41 | 41 | IfIssetToCoalescingRector::class, |
| 42 | 42 | RemoveUnusedPrivatePropertyRector::class => [ |
| 43 | - __DIR__ . '/src/Scaffolder/src/Command/BootloaderCommand.php', |
|
| 44 | - __DIR__ . '/src/Scaffolder/src/Command/CommandCommand.php', |
|
| 45 | - __DIR__ . '/src/Scaffolder/src/Command/ConfigCommand.php', |
|
| 46 | - __DIR__ . '/src/Scaffolder/src/Command/ControllerCommand.php', |
|
| 47 | - __DIR__ . '/src/Scaffolder/src/Command/FilterCommand.php', |
|
| 48 | - __DIR__ . '/src/Scaffolder/src/Command/JobHandlerCommand.php', |
|
| 49 | - __DIR__ . '/src/Scaffolder/src/Command/MiddlewareCommand.php', |
|
| 50 | - __DIR__ . '/src/Console/tests/PromptArgumentsTest.php', |
|
| 43 | + __DIR__.'/src/Scaffolder/src/Command/BootloaderCommand.php', |
|
| 44 | + __DIR__.'/src/Scaffolder/src/Command/CommandCommand.php', |
|
| 45 | + __DIR__.'/src/Scaffolder/src/Command/ConfigCommand.php', |
|
| 46 | + __DIR__.'/src/Scaffolder/src/Command/ControllerCommand.php', |
|
| 47 | + __DIR__.'/src/Scaffolder/src/Command/FilterCommand.php', |
|
| 48 | + __DIR__.'/src/Scaffolder/src/Command/JobHandlerCommand.php', |
|
| 49 | + __DIR__.'/src/Scaffolder/src/Command/MiddlewareCommand.php', |
|
| 50 | + __DIR__.'/src/Console/tests/PromptArgumentsTest.php', |
|
| 51 | 51 | ], |
| 52 | 52 | RemoveUnusedPrivateMethodRector::class => [ |
| 53 | - __DIR__ . '/src/Boot/src/Bootloader/ConfigurationBootloader.php', |
|
| 54 | - __DIR__ . '/src/Broadcasting/src/Bootloader/BroadcastingBootloader.php', |
|
| 55 | - __DIR__ . '/src/Cache/src/Bootloader/CacheBootloader.php', |
|
| 56 | - __DIR__ . '/src/Serializer/src/Bootloader/SerializerBootloader.php', |
|
| 57 | - __DIR__ . '/src/Validation/src/Bootloader/ValidationBootloader.php', |
|
| 58 | - __DIR__ . '/src/Translator/tests/IndexerTest.php', |
|
| 59 | - __DIR__ . '/src/Tokenizer/tests/ReflectionFileTest.php', |
|
| 60 | - __DIR__ . '/src/Core/tests/SingletonsTest.php', |
|
| 53 | + __DIR__.'/src/Boot/src/Bootloader/ConfigurationBootloader.php', |
|
| 54 | + __DIR__.'/src/Broadcasting/src/Bootloader/BroadcastingBootloader.php', |
|
| 55 | + __DIR__.'/src/Cache/src/Bootloader/CacheBootloader.php', |
|
| 56 | + __DIR__.'/src/Serializer/src/Bootloader/SerializerBootloader.php', |
|
| 57 | + __DIR__.'/src/Validation/src/Bootloader/ValidationBootloader.php', |
|
| 58 | + __DIR__.'/src/Translator/tests/IndexerTest.php', |
|
| 59 | + __DIR__.'/src/Tokenizer/tests/ReflectionFileTest.php', |
|
| 60 | + __DIR__.'/src/Core/tests/SingletonsTest.php', |
|
| 61 | 61 | ], |
| 62 | 62 | RemoveUselessVarTagRector::class => [ |
| 63 | - __DIR__ . '/src/Console/src/Traits/HelpersTrait.php', |
|
| 63 | + __DIR__.'/src/Console/src/Traits/HelpersTrait.php', |
|
| 64 | 64 | ], |
| 65 | 65 | RemoveAlwaysTrueIfConditionRector::class => [ |
| 66 | - __DIR__ . '/src/Boot/src/BootloadManager/Initializer.php', |
|
| 67 | - __DIR__ . '/src/Stempler/src/Traverser.php', |
|
| 68 | - __DIR__ . '/src/Prototype/src/NodeVisitors/LocateProperties.php', |
|
| 69 | - __DIR__ . '/src/Prototype/src/NodeVisitors/RemoveTrait.php', |
|
| 70 | - __DIR__ . '/src/Logger/src/ListenerRegistry.php', |
|
| 71 | - __DIR__ . '/src/Stempler/src/Transform/Merge/ExtendsParent.php', |
|
| 72 | - __DIR__ . '/src/Bridge/Stempler/src/StemplerEngine.php', |
|
| 66 | + __DIR__.'/src/Boot/src/BootloadManager/Initializer.php', |
|
| 67 | + __DIR__.'/src/Stempler/src/Traverser.php', |
|
| 68 | + __DIR__.'/src/Prototype/src/NodeVisitors/LocateProperties.php', |
|
| 69 | + __DIR__.'/src/Prototype/src/NodeVisitors/RemoveTrait.php', |
|
| 70 | + __DIR__.'/src/Logger/src/ListenerRegistry.php', |
|
| 71 | + __DIR__.'/src/Stempler/src/Transform/Merge/ExtendsParent.php', |
|
| 72 | + __DIR__.'/src/Bridge/Stempler/src/StemplerEngine.php', |
|
| 73 | 73 | ], |
| 74 | 74 | RemoveExtraParametersRector::class => [ |
| 75 | - __DIR__ . '/src/Boot/src/BootloadManager/AbstractBootloadManager.php', |
|
| 75 | + __DIR__.'/src/Boot/src/BootloadManager/AbstractBootloadManager.php', |
|
| 76 | 76 | ], |
| 77 | 77 | RemoveUnusedPrivateMethodParameterRector::class => [ |
| 78 | - __DIR__ . '/src/Core/src/Internal/Factory.php', |
|
| 79 | - __DIR__ . '/src/Core/tests/InjectableTest.php', |
|
| 78 | + __DIR__.'/src/Core/src/Internal/Factory.php', |
|
| 79 | + __DIR__.'/src/Core/tests/InjectableTest.php', |
|
| 80 | 80 | ], |
| 81 | 81 | RemoveDoubleAssignRector::class => [ |
| 82 | - __DIR__ . '/src/Core/tests/Scope/FinalizeAttributeTest.php', |
|
| 82 | + __DIR__.'/src/Core/tests/Scope/FinalizeAttributeTest.php', |
|
| 83 | 83 | ], |
| 84 | 84 | RemoveUnusedVariableAssignRector::class => [ |
| 85 | - __DIR__ . '/src/Core/tests/ExceptionsTest.php', |
|
| 85 | + __DIR__.'/src/Core/tests/ExceptionsTest.php', |
|
| 86 | 86 | ], |
| 87 | 87 | RemoveDeadStmtRector::class => [ |
| 88 | - __DIR__ . '/src/Core/tests/ExceptionsTest.php', |
|
| 88 | + __DIR__.'/src/Core/tests/ExceptionsTest.php', |
|
| 89 | 89 | ], |
| 90 | 90 | |
| 91 | 91 | // to be enabled later for bc break 4.x |
@@ -95,8 +95,8 @@ discard block |
||
| 95 | 95 | NewInInitializerRector::class, |
| 96 | 96 | |
| 97 | 97 | // start with short open tag |
| 98 | - __DIR__ . '/src/Views/tests/fixtures/other/var.php', |
|
| 99 | - __DIR__ . '/tests/app/views/native.php', |
|
| 98 | + __DIR__.'/src/Views/tests/fixtures/other/var.php', |
|
| 99 | + __DIR__.'/tests/app/views/native.php', |
|
| 100 | 100 | |
| 101 | 101 | // example code for test |
| 102 | 102 | '*/Fixture/*', |
@@ -106,24 +106,24 @@ discard block |
||
| 106 | 106 | '*/Stubs/*', |
| 107 | 107 | '*/tests/Classes/*', |
| 108 | 108 | '*/tests/Internal/*', |
| 109 | - __DIR__ . '/src/Console/tests/Configurator', |
|
| 109 | + __DIR__.'/src/Console/tests/Configurator', |
|
| 110 | 110 | |
| 111 | 111 | // cache |
| 112 | 112 | '*/runtime/cache/*', |
| 113 | 113 | |
| 114 | 114 | ReadOnlyPropertyRector::class => [ |
| 115 | 115 | // used by Configurator |
| 116 | - __DIR__ . '/src/Scaffolder/src/Command', |
|
| 116 | + __DIR__.'/src/Scaffolder/src/Command', |
|
| 117 | 117 | ], |
| 118 | 118 | |
| 119 | 119 | FirstClassCallableRector::class => [ |
| 120 | - __DIR__ . '/src/Core/tests/Scope/UseCaseTest.php', |
|
| 120 | + __DIR__.'/src/Core/tests/Scope/UseCaseTest.php', |
|
| 121 | 121 | ], |
| 122 | 122 | |
| 123 | 123 | PreferPHPUnitThisCallRector::class, |
| 124 | 124 | |
| 125 | 125 | MakeInheritedMethodVisibilitySameAsParentRector::class => [ |
| 126 | - __DIR__ . '/src/Models/tests/PublicEntity.php', |
|
| 126 | + __DIR__.'/src/Models/tests/PublicEntity.php', |
|
| 127 | 127 | ], |
| 128 | 128 | ]) |
| 129 | 129 | ->withPhpSets(php81: true) |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | class StreamsTest extends TestCase |
| 12 | 12 | { |
| 13 | - private const FIXTURE_DIRECTORY = __DIR__ . '/fixtures'; |
|
| 13 | + private const FIXTURE_DIRECTORY = __DIR__.'/fixtures'; |
|
| 14 | 14 | |
| 15 | 15 | protected function setUp(): void |
| 16 | 16 | { |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | self::assertSame(strlen('sample text'), filesize($filename)); |
| 36 | 36 | self::assertSame(md5('sample text'), md5_file($filename)); |
| 37 | 37 | |
| 38 | - $newFilename = self::FIXTURE_DIRECTORY . '/test.txt'; |
|
| 38 | + $newFilename = self::FIXTURE_DIRECTORY.'/test.txt'; |
|
| 39 | 39 | copy($filename, $newFilename); |
| 40 | 40 | |
| 41 | 41 | self::assertFileExists($newFilename); |
@@ -76,15 +76,15 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | public function testException(): void |
| 78 | 78 | { |
| 79 | - try { |
|
| 79 | + try{ |
|
| 80 | 80 | fopen('spiral://non-exists', 'rb'); |
| 81 | - } catch (\Throwable $e) { |
|
| 81 | + }catch (\Throwable $e){ |
|
| 82 | 82 | self::assertStringContainsString('failed to open stream', $e->getMessage()); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - try { |
|
| 85 | + try{ |
|
| 86 | 86 | filemtime('spiral://non-exists'); |
| 87 | - } catch (\Throwable $e) { |
|
| 87 | + }catch (\Throwable $e){ |
|
| 88 | 88 | self::assertStringContainsString('stat failed', $e->getMessage()); |
| 89 | 89 | } |
| 90 | 90 | } |
@@ -94,15 +94,15 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | public function testExceptionPHP8(): void |
| 96 | 96 | { |
| 97 | - try { |
|
| 97 | + try{ |
|
| 98 | 98 | fopen('spiral://non-exists', 'rb'); |
| 99 | - } catch (\Throwable $e) { |
|
| 99 | + }catch (\Throwable $e){ |
|
| 100 | 100 | self::assertStringContainsString('Failed to open stream', $e->getMessage()); |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - try { |
|
| 103 | + try{ |
|
| 104 | 104 | filemtime('spiral://non-exists'); |
| 105 | - } catch (\Throwable $e) { |
|
| 105 | + }catch (\Throwable $e){ |
|
| 106 | 106 | self::assertStringContainsString('stat failed', $e->getMessage()); |
| 107 | 107 | } |
| 108 | 108 | } |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | { |
| 16 | 16 | protected function tearDown(): void |
| 17 | 17 | { |
| 18 | - if ((int)session_status() === PHP_SESSION_ACTIVE) { |
|
| 18 | + if ((int)session_status() === PHP_SESSION_ACTIVE){ |
|
| 19 | 19 | session_abort(); |
| 20 | 20 | } |
| 21 | 21 | } |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | protected function tearDown(): void |
| 41 | 41 | { |
| 42 | - if ((int)session_status() === PHP_SESSION_ACTIVE) { |
|
| 42 | + if ((int)session_status() === PHP_SESSION_ACTIVE){ |
|
| 43 | 43 | session_abort(); |
| 44 | 44 | } |
| 45 | 45 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | self::assertSame('default', $section->getName()); |
| 114 | 114 | |
| 115 | 115 | $section->set('key', 'value'); |
| 116 | - foreach ($section as $key => $value) { |
|
| 116 | + foreach ($section as $key => $value){ |
|
| 117 | 117 | self::assertSame('key', $key); |
| 118 | 118 | self::assertSame('value', $value); |
| 119 | 119 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | protected function setUp(): void |
| 22 | 22 | { |
| 23 | 23 | $this->app = TestApp::create([ |
| 24 | - 'root' => __DIR__ . '/App', |
|
| 24 | + 'root' => __DIR__.'/App', |
|
| 25 | 25 | ], false)->run(); |
| 26 | 26 | } |
| 27 | 27 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | final class AttributeMapperTest extends BaseTestCase |
| 28 | 28 | { |
| 29 | - private m\LegacyMockInterface|m\MockInterface|FilterProviderInterface $provider; |
|
| 29 | + private m\LegacyMockInterface | m\MockInterface | FilterProviderInterface $provider; |
|
| 30 | 30 | private AttributeMapper $mapper; |
| 31 | 31 | |
| 32 | 32 | protected function setUp(): void |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | ->andReturn(['first' => ['foo' => 'bar'], 'second' => ['foo' => 'baz']]); |
| 75 | 75 | |
| 76 | 76 | [$schema, $errors] = $this->mapper->map( |
| 77 | - $filter = new class implements FilterInterface { |
|
| 77 | + $filter = new class implements FilterInterface{ |
|
| 78 | 78 | #[Post] |
| 79 | 79 | public string $username; |
| 80 | 80 | |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | ->andReturn(['first' => ['foo' => 'bar'], 'second' => ['foo' => 'baz']]); |
| 171 | 171 | |
| 172 | 172 | [$schema, $errors] = $this->mapper->map( |
| 173 | - $filter = new class implements FilterInterface { |
|
| 173 | + $filter = new class implements FilterInterface{ |
|
| 174 | 174 | #[Post] |
| 175 | 175 | public string $username; |
| 176 | 176 | |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | |
| 17 | 17 | final class InputMapperTest extends BaseTestCase |
| 18 | 18 | { |
| 19 | - private m\LegacyMockInterface|m\MockInterface|FilterProviderInterface $provider; |
|
| 19 | + private m\LegacyMockInterface | m\MockInterface | FilterProviderInterface $provider; |
|
| 20 | 20 | private InputMapper $mapper; |
| 21 | 21 | |
| 22 | 22 | protected function setUp(): void |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | protected function setUp(): void |
| 31 | 31 | { |
| 32 | - if (!\class_exists(Kernel::class)) { |
|
| 32 | + if (!\class_exists(Kernel::class)){ |
|
| 33 | 33 | $this->markTestSkipped('A "spiral/framework" dependency is required to run these tests'); |
| 34 | 34 | } |
| 35 | 35 | |
@@ -40,16 +40,16 @@ discard block |
||
| 40 | 40 | 'cache' => sys_get_temp_dir() |
| 41 | 41 | ], false)->run(); |
| 42 | 42 | |
| 43 | - $this->storage = new Storage($this->dir() . '/Fixtures/'); |
|
| 43 | + $this->storage = new Storage($this->dir().'/Fixtures/'); |
|
| 44 | 44 | |
| 45 | - foreach (static::STORE as $name) { |
|
| 45 | + foreach (static::STORE as $name){ |
|
| 46 | 46 | $this->storage->store($name); |
| 47 | 47 | } |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | protected function tearDown(): void |
| 51 | 51 | { |
| 52 | - foreach (static::STORE as $name) { |
|
| 52 | + foreach (static::STORE as $name){ |
|
| 53 | 53 | $this->storage->restore($name); |
| 54 | 54 | } |
| 55 | 55 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | { |
| 20 | 20 | protected function setUp(): void |
| 21 | 21 | { |
| 22 | - if ((string)ini_get('zend.assertions') === 1) { |
|
| 22 | + if ((string)ini_get('zend.assertions') === 1){ |
|
| 23 | 23 | ini_set('zend.assertions', 0); |
| 24 | 24 | } |
| 25 | 25 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | { |
| 33 | 33 | $i = new Injector(); |
| 34 | 34 | |
| 35 | - $filename = __DIR__ . '/Fixtures/TestClass.php'; |
|
| 35 | + $filename = __DIR__.'/Fixtures/TestClass.php'; |
|
| 36 | 36 | $printed = $i->injectDependencies( |
| 37 | 37 | file_get_contents($filename), |
| 38 | 38 | $this->getDefinition($filename, ['testClass' => TestClass::class]) |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | { |
| 46 | 46 | $i = new Injector(); |
| 47 | 47 | |
| 48 | - $filename = __DIR__ . '/Fixtures/WithPromotedProperty.php'; |
|
| 48 | + $filename = __DIR__.'/Fixtures/WithPromotedProperty.php'; |
|
| 49 | 49 | $printed = $i->injectDependencies( |
| 50 | 50 | file_get_contents($filename), |
| 51 | 51 | $this->getDefinition($filename, ['two' => InjectionTwo::class]) |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | { |
| 63 | 63 | $i = new Injector(); |
| 64 | 64 | |
| 65 | - $filename = __DIR__ . '/Fixtures/TestEmptyClass.php'; |
|
| 65 | + $filename = __DIR__.'/Fixtures/TestEmptyClass.php'; |
|
| 66 | 66 | $content = file_get_contents($filename); |
| 67 | 67 | $printed = $i->injectDependencies( |
| 68 | 68 | file_get_contents($filename), |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | { |
| 81 | 81 | $i = new Injector(); |
| 82 | 82 | |
| 83 | - $filename = __DIR__ . '/Fixtures/TestClass.php'; |
|
| 83 | + $filename = __DIR__.'/Fixtures/TestClass.php'; |
|
| 84 | 84 | $r = $i->injectDependencies( |
| 85 | 85 | file_get_contents($filename), |
| 86 | 86 | $this->getDefinition($filename, ['testClass' => TestClass::class]) |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | { |
| 106 | 106 | $i = new Injector(); |
| 107 | 107 | |
| 108 | - $filename = __DIR__ . '/Fixtures/ChildClass.php'; |
|
| 108 | + $filename = __DIR__.'/Fixtures/ChildClass.php'; |
|
| 109 | 109 | $r = $i->injectDependencies( |
| 110 | 110 | file_get_contents($filename), |
| 111 | 111 | $this->getDefinition($filename, ['testClass' => TestClass::class]) |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | { |
| 124 | 124 | $i = new Injector(); |
| 125 | 125 | |
| 126 | - $filename = __DIR__ . '/Fixtures/ChildWithConstructorClass.php'; |
|
| 126 | + $filename = __DIR__.'/Fixtures/ChildWithConstructorClass.php'; |
|
| 127 | 127 | $r = $i->injectDependencies( |
| 128 | 128 | file_get_contents($filename), |
| 129 | 129 | $this->getDefinition($filename, ['testClass' => TestClass::class]) |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | */ |
| 140 | 140 | public function testModifyConstructor(): void |
| 141 | 141 | { |
| 142 | - $filename = __DIR__ . '/Fixtures/WithConstructor.php'; |
|
| 142 | + $filename = __DIR__.'/Fixtures/WithConstructor.php'; |
|
| 143 | 143 | $extractor = new Traverse\Extractor(); |
| 144 | 144 | |
| 145 | 145 | $parameters = $extractor->extractFromFilename($filename); |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | */ |
| 166 | 166 | public function testPriorOptionalConstructorParameters(): void |
| 167 | 167 | { |
| 168 | - $filename = __DIR__ . '/Fixtures/OptionalConstructorArgsClass.php'; |
|
| 168 | + $filename = __DIR__.'/Fixtures/OptionalConstructorArgsClass.php'; |
|
| 169 | 169 | $extractor = new Traverse\Extractor(); |
| 170 | 170 | |
| 171 | 171 | $parameters = $extractor->extractFromFilename($filename); |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | { |
| 197 | 197 | $i = new Injector(); |
| 198 | 198 | |
| 199 | - $filename = __DIR__ . '/ClassNode/ConflictResolver/Fixtures/ChildClass.php'; |
|
| 199 | + $filename = __DIR__.'/ClassNode/ConflictResolver/Fixtures/ChildClass.php'; |
|
| 200 | 200 | $printed = $i->injectDependencies( |
| 201 | 201 | file_get_contents($filename), |
| 202 | 202 | $this->getDefinition( |