@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | public 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 | public 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 | } |
@@ -27,59 +27,59 @@ discard block |
||
27 | 27 | |
28 | 28 | return RectorConfig::configure() |
29 | 29 | ->withPaths([ |
30 | - __DIR__ . '/src/*/src', |
|
31 | - __DIR__ . '/src/*/tests', |
|
32 | - __DIR__ . '/tests', |
|
30 | + __DIR__.'/src/*/src', |
|
31 | + __DIR__.'/src/*/tests', |
|
32 | + __DIR__.'/tests', |
|
33 | 33 | ]) |
34 | 34 | ->withParallel() |
35 | 35 | ->withSkip([ |
36 | 36 | IfIssetToCoalescingRector::class, |
37 | 37 | RemoveUnusedPrivatePropertyRector::class => [ |
38 | - __DIR__ . '/src/Scaffolder/src/Command/BootloaderCommand.php', |
|
39 | - __DIR__ . '/src/Scaffolder/src/Command/CommandCommand.php', |
|
40 | - __DIR__ . '/src/Scaffolder/src/Command/ConfigCommand.php', |
|
41 | - __DIR__ . '/src/Scaffolder/src/Command/ControllerCommand.php', |
|
42 | - __DIR__ . '/src/Scaffolder/src/Command/FilterCommand.php', |
|
43 | - __DIR__ . '/src/Scaffolder/src/Command/JobHandlerCommand.php', |
|
44 | - __DIR__ . '/src/Scaffolder/src/Command/MiddlewareCommand.php', |
|
45 | - __DIR__ . '/src/Console/tests/PromptArgumentsTest.php', |
|
38 | + __DIR__.'/src/Scaffolder/src/Command/BootloaderCommand.php', |
|
39 | + __DIR__.'/src/Scaffolder/src/Command/CommandCommand.php', |
|
40 | + __DIR__.'/src/Scaffolder/src/Command/ConfigCommand.php', |
|
41 | + __DIR__.'/src/Scaffolder/src/Command/ControllerCommand.php', |
|
42 | + __DIR__.'/src/Scaffolder/src/Command/FilterCommand.php', |
|
43 | + __DIR__.'/src/Scaffolder/src/Command/JobHandlerCommand.php', |
|
44 | + __DIR__.'/src/Scaffolder/src/Command/MiddlewareCommand.php', |
|
45 | + __DIR__.'/src/Console/tests/PromptArgumentsTest.php', |
|
46 | 46 | ], |
47 | 47 | RemoveUnusedPrivateMethodRector::class => [ |
48 | - __DIR__ . '/src/Boot/src/Bootloader/ConfigurationBootloader.php', |
|
49 | - __DIR__ . '/src/Broadcasting/src/Bootloader/BroadcastingBootloader.php', |
|
50 | - __DIR__ . '/src/Cache/src/Bootloader/CacheBootloader.php', |
|
51 | - __DIR__ . '/src/Serializer/src/Bootloader/SerializerBootloader.php', |
|
52 | - __DIR__ . '/src/Validation/src/Bootloader/ValidationBootloader.php', |
|
53 | - __DIR__ . '/src/Translator/tests/IndexerTest.php', |
|
54 | - __DIR__ . '/src/Tokenizer/tests/ReflectionFileTest.php', |
|
55 | - __DIR__ . '/src/Core/tests/SingletonsTest.php', |
|
48 | + __DIR__.'/src/Boot/src/Bootloader/ConfigurationBootloader.php', |
|
49 | + __DIR__.'/src/Broadcasting/src/Bootloader/BroadcastingBootloader.php', |
|
50 | + __DIR__.'/src/Cache/src/Bootloader/CacheBootloader.php', |
|
51 | + __DIR__.'/src/Serializer/src/Bootloader/SerializerBootloader.php', |
|
52 | + __DIR__.'/src/Validation/src/Bootloader/ValidationBootloader.php', |
|
53 | + __DIR__.'/src/Translator/tests/IndexerTest.php', |
|
54 | + __DIR__.'/src/Tokenizer/tests/ReflectionFileTest.php', |
|
55 | + __DIR__.'/src/Core/tests/SingletonsTest.php', |
|
56 | 56 | ], |
57 | 57 | RemoveUselessVarTagRector::class => [ |
58 | - __DIR__ . '/src/Console/src/Traits/HelpersTrait.php', |
|
58 | + __DIR__.'/src/Console/src/Traits/HelpersTrait.php', |
|
59 | 59 | ], |
60 | 60 | RemoveAlwaysTrueIfConditionRector::class => [ |
61 | - __DIR__ . '/src/Boot/src/BootloadManager/Initializer.php', |
|
62 | - __DIR__ . '/src/Stempler/src/Traverser.php', |
|
63 | - __DIR__ . '/src/Prototype/src/NodeVisitors/LocateProperties.php', |
|
64 | - __DIR__ . '/src/Prototype/src/NodeVisitors/RemoveTrait.php', |
|
65 | - __DIR__ . '/src/Logger/src/ListenerRegistry.php', |
|
66 | - __DIR__ . '/src/Stempler/src/Transform/Merge/ExtendsParent.php', |
|
61 | + __DIR__.'/src/Boot/src/BootloadManager/Initializer.php', |
|
62 | + __DIR__.'/src/Stempler/src/Traverser.php', |
|
63 | + __DIR__.'/src/Prototype/src/NodeVisitors/LocateProperties.php', |
|
64 | + __DIR__.'/src/Prototype/src/NodeVisitors/RemoveTrait.php', |
|
65 | + __DIR__.'/src/Logger/src/ListenerRegistry.php', |
|
66 | + __DIR__.'/src/Stempler/src/Transform/Merge/ExtendsParent.php', |
|
67 | 67 | ], |
68 | 68 | RemoveExtraParametersRector::class => [ |
69 | - __DIR__ . '/src/Boot/src/BootloadManager/AbstractBootloadManager.php', |
|
69 | + __DIR__.'/src/Boot/src/BootloadManager/AbstractBootloadManager.php', |
|
70 | 70 | ], |
71 | 71 | RemoveUnusedPrivateMethodParameterRector::class => [ |
72 | - __DIR__ . '/src/Core/src/Internal/Factory.php', |
|
73 | - __DIR__ . '/src/Core/tests/InjectableTest.php', |
|
72 | + __DIR__.'/src/Core/src/Internal/Factory.php', |
|
73 | + __DIR__.'/src/Core/tests/InjectableTest.php', |
|
74 | 74 | ], |
75 | 75 | RemoveDoubleAssignRector::class => [ |
76 | - __DIR__ . '/src/Core/tests/Scope/FinalizeAttributeTest.php', |
|
76 | + __DIR__.'/src/Core/tests/Scope/FinalizeAttributeTest.php', |
|
77 | 77 | ], |
78 | 78 | RemoveUnusedVariableAssignRector::class => [ |
79 | - __DIR__ . '/src/Core/tests/ExceptionsTest.php', |
|
79 | + __DIR__.'/src/Core/tests/ExceptionsTest.php', |
|
80 | 80 | ], |
81 | 81 | RemoveDeadStmtRector::class => [ |
82 | - __DIR__ . '/src/Core/tests/ExceptionsTest.php', |
|
82 | + __DIR__.'/src/Core/tests/ExceptionsTest.php', |
|
83 | 83 | ], |
84 | 84 | |
85 | 85 | // to be enabled later for bc break 4.x |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | NewInInitializerRector::class, |
90 | 90 | |
91 | 91 | // start with short open tag |
92 | - __DIR__ . '/src/Views/tests/fixtures/other/var.php', |
|
93 | - __DIR__ . '/tests/app/views/native.php', |
|
92 | + __DIR__.'/src/Views/tests/fixtures/other/var.php', |
|
93 | + __DIR__.'/tests/app/views/native.php', |
|
94 | 94 | |
95 | 95 | // example code for test |
96 | 96 | '*/Fixture/*', |
@@ -100,18 +100,18 @@ discard block |
||
100 | 100 | '*/Stubs/*', |
101 | 101 | '*/tests/Classes/*', |
102 | 102 | '*/tests/Internal/*', |
103 | - __DIR__ . '/src/Console/tests/Configurator', |
|
103 | + __DIR__.'/src/Console/tests/Configurator', |
|
104 | 104 | |
105 | 105 | // cache |
106 | 106 | '*/runtime/cache/*', |
107 | 107 | |
108 | 108 | ReadOnlyPropertyRector::class => [ |
109 | 109 | // used by Configurator |
110 | - __DIR__ . '/src/Scaffolder/src/Command', |
|
110 | + __DIR__.'/src/Scaffolder/src/Command', |
|
111 | 111 | ], |
112 | 112 | |
113 | 113 | FirstClassCallableRector::class => [ |
114 | - __DIR__ . '/src/Core/tests/Scope/UseCaseTest.php', |
|
114 | + __DIR__.'/src/Core/tests/Scope/UseCaseTest.php', |
|
115 | 115 | ], |
116 | 116 | |
117 | 117 | PreferPHPUnitThisCallRector::class, |
@@ -135,9 +135,9 @@ discard block |
||
135 | 135 | { |
136 | 136 | $container = new Container(); |
137 | 137 | |
138 | - try { |
|
138 | + try{ |
|
139 | 139 | $container->get('invalid'); |
140 | - } catch (ContainerException $e) { |
|
140 | + }catch (ContainerException $e){ |
|
141 | 141 | self::assertSame(<<<MARKDOWN |
142 | 142 | Can't resolve `invalid`: undefined class or binding `invalid`. |
143 | 143 | Container trace list: |
@@ -166,9 +166,9 @@ discard block |
||
166 | 166 | { |
167 | 167 | $this->expectException(ContainerException::class); |
168 | 168 | |
169 | - try { |
|
169 | + try{ |
|
170 | 170 | $container->get(ClassWithUndefinedDependency::class); |
171 | - } catch (ContainerException $e) { |
|
171 | + }catch (ContainerException $e){ |
|
172 | 172 | self::assertSame($message, $e->getMessage()); |
173 | 173 | |
174 | 174 | throw $e; |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | |
33 | 33 | self::assertNull(ContainerScope::getContainer()); |
34 | 34 | |
35 | - try { |
|
35 | + try{ |
|
36 | 36 | self::assertTrue(ContainerScope::runScope($container, static function (): never { |
37 | 37 | throw new RuntimeException('exception'); |
38 | 38 | })); |
39 | - } catch (\Throwable $e) { |
|
39 | + }catch (\Throwable $e){ |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | self::assertInstanceOf(RuntimeException::class, $e); |
@@ -83,14 +83,14 @@ discard block |
||
83 | 83 | return $c->get('bucket')->getName() == 'b' && $c->has('other'); |
84 | 84 | })); |
85 | 85 | |
86 | - try { |
|
86 | + try{ |
|
87 | 87 | self::assertTrue($c->runScope([ |
88 | 88 | 'bucket' => new Bucket('b'), |
89 | 89 | 'other' => new SampleClass() |
90 | 90 | ], function () use ($c): void { |
91 | 91 | throw new RuntimeException('exception'); |
92 | 92 | })); |
93 | - } catch (\Throwable) { |
|
93 | + }catch (\Throwable){ |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | self::assertSame('a', $c->get('bucket')->getName()); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | $logger = $root->runScope( |
63 | 63 | new Scope('test'), |
64 | - static fn(?ScopeIndicatorLogger $logger): ?ScopeIndicatorLogger => $logger, |
|
64 | + static fn(?ScopeIndicatorLogger $logger) : ?ScopeIndicatorLogger => $logger, |
|
65 | 65 | ); |
66 | 66 | |
67 | 67 | self::assertNotNull($logger); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | $logger = $root->runScope( |
79 | 79 | new Scope('test'), |
80 | - static fn(?ScopeIndicatorLogger $logger): ?ScopeIndicatorLogger => $logger, |
|
80 | + static fn(?ScopeIndicatorLogger $logger) : ?ScopeIndicatorLogger => $logger, |
|
81 | 81 | ); |
82 | 82 | |
83 | 83 | self::assertNotNull($logger); |
@@ -65,17 +65,17 @@ discard block |
||
65 | 65 | |
66 | 66 | public function testClassWithNamespace(): void |
67 | 67 | { |
68 | - self::assertSame('function (?' . Container::class . ' ...$v)', $this->renderClosureForTesting(fn (?Container ...$v) => null)); |
|
68 | + self::assertSame('function (?'.Container::class.' ...$v)', $this->renderClosureForTesting(fn (?Container ...$v) => null)); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | public function testUnionTypes(): void |
72 | 72 | { |
73 | - self::assertSame('function (self|string|int|null $v)', $this->renderClosureForTesting(fn (self|string|int|null $v) => null)); |
|
73 | + self::assertSame('function (self|string|int|null $v)', $this->renderClosureForTesting(fn (self | string | int | null $v) => null)); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | public function testTypeIntersection(): void |
77 | 77 | { |
78 | - self::assertSame('function (' . ContainerInterface::class . '&' . ContainerExceptionInterface::class . ' $v)', $this->renderClosureForTesting(fn (ContainerInterface&ContainerExceptionInterface $v) => null)); |
|
78 | + self::assertSame('function ('.ContainerInterface::class.'&'.ContainerExceptionInterface::class.' $v)', $this->renderClosureForTesting(fn (ContainerInterface&ContainerExceptionInterface $v) => null)); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | public function testFunctionFromEval(): void |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | public function testUnavailableClasses(): void |
88 | 88 | { |
89 | - self::assertSame('function (Foo|Bar $v)', $this->renderClosureForTesting(fn (\Foo|\Bar $v) => null)); |
|
89 | + self::assertSame('function (Foo|Bar $v)', $this->renderClosureForTesting(fn (\Foo | \Bar $v) => null)); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | public function testDefaultObjectValue(): void |
@@ -16,17 +16,17 @@ discard block |
||
16 | 16 | self::assertContains(TestTrait::class, $reflection->getTraits()); |
17 | 17 | self::assertContains(TestInterface::class, $reflection->getInterfaces()); |
18 | 18 | |
19 | - self::assertSame([__NAMESPACE__ . '\hello'], $reflection->getFunctions()); |
|
19 | + self::assertSame([__NAMESPACE__.'\hello'], $reflection->getFunctions()); |
|
20 | 20 | |
21 | 21 | $functionA = null; |
22 | 22 | $functionB = null; |
23 | 23 | |
24 | - foreach ($reflection->getInvocations() as $invocation) { |
|
25 | - if ($invocation->getName() == 'test_function_a') { |
|
24 | + foreach ($reflection->getInvocations() as $invocation){ |
|
25 | + if ($invocation->getName() == 'test_function_a'){ |
|
26 | 26 | $functionA = $invocation; |
27 | 27 | } |
28 | 28 | |
29 | - if ($invocation->getName() == 'test_function_b') { |
|
29 | + if ($invocation->getName() == 'test_function_b'){ |
|
30 | 30 | $functionB = $invocation; |
31 | 31 | } |
32 | 32 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | public function testReflectionFileWithNamedParameters(): void |
55 | 55 | { |
56 | - $reflection = new ReflectionFile(__DIR__ . '/Classes/ClassWithNamedParameter.php'); |
|
56 | + $reflection = new ReflectionFile(__DIR__.'/Classes/ClassWithNamedParameter.php'); |
|
57 | 57 | |
58 | 58 | self::assertSame([ |
59 | 59 | \Spiral\Tests\Tokenizer\Classes\ClassWithNamedParameter::class, |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | |
63 | 63 | public function testReflectionFileAnonymousClass(): void |
64 | 64 | { |
65 | - $reflection = new ReflectionFile(__DIR__ . '/Classes/ClassWithAnonymousClass.php'); |
|
65 | + $reflection = new ReflectionFile(__DIR__.'/Classes/ClassWithAnonymousClass.php'); |
|
66 | 66 | |
67 | 67 | self::assertSame([ |
68 | 68 | \Spiral\Tests\Tokenizer\Classes\ClassWithAnonymousClass::class, |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | public function testReflectionFileWithHeredoc(): void |
73 | 73 | { |
74 | - $reflection = new ReflectionFile(__DIR__ . '/Classes/ClassWithHeredoc.php'); |
|
74 | + $reflection = new ReflectionFile(__DIR__.'/Classes/ClassWithHeredoc.php'); |
|
75 | 75 | |
76 | 76 | self::assertSame([ |
77 | 77 | 'Spiral\Tests\Tokenizer\Classes\ClassWithHeredoc', |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | public function testReflectionEnum(): void |
82 | 82 | { |
83 | - $reflection = new ReflectionFile(__DIR__ . '/Classes/ClassD.php'); |
|
83 | + $reflection = new ReflectionFile(__DIR__.'/Classes/ClassD.php'); |
|
84 | 84 | |
85 | 85 | self::assertSame([ |
86 | 86 | \Spiral\Tests\Tokenizer\Classes\ClassD::class, |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | |
90 | 90 | public function testReflectionTypedEnum(): void |
91 | 91 | { |
92 | - $reflection = new ReflectionFile(__DIR__ . '/Classes/ClassE.php'); |
|
92 | + $reflection = new ReflectionFile(__DIR__.'/Classes/ClassE.php'); |
|
93 | 93 | |
94 | 94 | self::assertSame([ |
95 | 95 | \Spiral\Tests\Tokenizer\Classes\ClassE::class, |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | public function testReflectionInterface(): void |
100 | 100 | { |
101 | - $reflection = new ReflectionFile(__DIR__ . '/Interfaces/InterfaceA.php'); |
|
101 | + $reflection = new ReflectionFile(__DIR__.'/Interfaces/InterfaceA.php'); |
|
102 | 102 | |
103 | 103 | self::assertSame([ |
104 | 104 | \Spiral\Tests\Tokenizer\Interfaces\InterfaceA::class, |
@@ -57,7 +57,7 @@ |
||
57 | 57 | $kernel = TestCoreWithTokenizer::create(directories: ['root' => __DIR__], container: $container); |
58 | 58 | $kernel->run(); |
59 | 59 | |
60 | - self::assertContains(\dirname(__DIR__) . '/Fixtures/Bootloader', $container->get(TokenizerConfig::class)->getDirectories()); |
|
60 | + self::assertContains(\dirname(__DIR__).'/Fixtures/Bootloader', $container->get(TokenizerConfig::class)->getDirectories()); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | } |
@@ -20,10 +20,10 @@ |
||
20 | 20 | public function testToString(): void |
21 | 21 | { |
22 | 22 | $attribute = new TargetAttribute('foo'); |
23 | - self::assertSame('3dc18b19eed74479a03c069dec2e8724', (string) $attribute); |
|
23 | + self::assertSame('3dc18b19eed74479a03c069dec2e8724', (string)$attribute); |
|
24 | 24 | |
25 | 25 | $attribute = new TargetAttribute('foo', 'bar'); |
26 | - self::assertSame('52ec767c53f3898bf6de6f6e88125dc8', (string) $attribute); |
|
26 | + self::assertSame('52ec767c53f3898bf6de6f6e88125dc8', (string)$attribute); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | public function testFilterAttrWithArgs(): void |