@@ -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 | } |
@@ -21,7 +21,8 @@ |
||
21 | 21 | |
22 | 22 | protected function setUp(): void |
23 | 23 | { |
24 | - $this->trait = new class { |
|
24 | + $this->trait = new class |
|
25 | + { |
|
25 | 26 | use LimitsTrait; |
26 | 27 | }; |
27 | 28 | } |
@@ -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 | } |
@@ -15,7 +15,8 @@ |
||
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 | 20 | session_abort(); |
20 | 21 | } |
21 | 22 | } |
@@ -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 | } |
@@ -39,7 +39,8 @@ 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 | 44 | session_abort(); |
44 | 45 | } |
45 | 46 | } |
@@ -113,7 +114,8 @@ discard block |
||
113 | 114 | self::assertSame('default', $section->getName()); |
114 | 115 | |
115 | 116 | $section->set('key', 'value'); |
116 | - foreach ($section as $key => $value) { |
|
117 | + foreach ($section as $key => $value) |
|
118 | + { |
|
117 | 119 | self::assertSame('key', $key); |
118 | 120 | self::assertSame('value', $value); |
119 | 121 | } |
@@ -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 |
@@ -28,7 +28,8 @@ |
||
28 | 28 | |
29 | 29 | protected function setUp(): void |
30 | 30 | { |
31 | - $this->trait = new class { |
|
31 | + $this->trait = new class |
|
32 | + { |
|
32 | 33 | use GuardedTrait; |
33 | 34 | }; |
34 | 35 | $this->guard = $this->createMock(GuardInterface::class); |