@@ -27,62 +27,62 @@ discard block |
||
27 | 27 | |
28 | 28 | return RectorConfig::configure() |
29 | 29 | ->withPaths([ |
30 | - __DIR__ . '/src/*/src', |
|
31 | - __DIR__ . '/src/*/*/src', |
|
32 | - __DIR__ . '/src/*/*/tests', |
|
33 | - __DIR__ . '/src/*/tests', |
|
34 | - __DIR__ . '/tests', |
|
30 | + __DIR__.'/src/*/src', |
|
31 | + __DIR__.'/src/*/*/src', |
|
32 | + __DIR__.'/src/*/*/tests', |
|
33 | + __DIR__.'/src/*/tests', |
|
34 | + __DIR__.'/tests', |
|
35 | 35 | ]) |
36 | 36 | ->withParallel() |
37 | 37 | ->withSkip([ |
38 | 38 | IfIssetToCoalescingRector::class, |
39 | 39 | RemoveUnusedPrivatePropertyRector::class => [ |
40 | - __DIR__ . '/src/Scaffolder/src/Command/BootloaderCommand.php', |
|
41 | - __DIR__ . '/src/Scaffolder/src/Command/CommandCommand.php', |
|
42 | - __DIR__ . '/src/Scaffolder/src/Command/ConfigCommand.php', |
|
43 | - __DIR__ . '/src/Scaffolder/src/Command/ControllerCommand.php', |
|
44 | - __DIR__ . '/src/Scaffolder/src/Command/FilterCommand.php', |
|
45 | - __DIR__ . '/src/Scaffolder/src/Command/JobHandlerCommand.php', |
|
46 | - __DIR__ . '/src/Scaffolder/src/Command/MiddlewareCommand.php', |
|
47 | - __DIR__ . '/src/Console/tests/PromptArgumentsTest.php', |
|
40 | + __DIR__.'/src/Scaffolder/src/Command/BootloaderCommand.php', |
|
41 | + __DIR__.'/src/Scaffolder/src/Command/CommandCommand.php', |
|
42 | + __DIR__.'/src/Scaffolder/src/Command/ConfigCommand.php', |
|
43 | + __DIR__.'/src/Scaffolder/src/Command/ControllerCommand.php', |
|
44 | + __DIR__.'/src/Scaffolder/src/Command/FilterCommand.php', |
|
45 | + __DIR__.'/src/Scaffolder/src/Command/JobHandlerCommand.php', |
|
46 | + __DIR__.'/src/Scaffolder/src/Command/MiddlewareCommand.php', |
|
47 | + __DIR__.'/src/Console/tests/PromptArgumentsTest.php', |
|
48 | 48 | ], |
49 | 49 | RemoveUnusedPrivateMethodRector::class => [ |
50 | - __DIR__ . '/src/Boot/src/Bootloader/ConfigurationBootloader.php', |
|
51 | - __DIR__ . '/src/Broadcasting/src/Bootloader/BroadcastingBootloader.php', |
|
52 | - __DIR__ . '/src/Cache/src/Bootloader/CacheBootloader.php', |
|
53 | - __DIR__ . '/src/Serializer/src/Bootloader/SerializerBootloader.php', |
|
54 | - __DIR__ . '/src/Validation/src/Bootloader/ValidationBootloader.php', |
|
55 | - __DIR__ . '/src/Translator/tests/IndexerTest.php', |
|
56 | - __DIR__ . '/src/Tokenizer/tests/ReflectionFileTest.php', |
|
57 | - __DIR__ . '/src/Core/tests/SingletonsTest.php', |
|
50 | + __DIR__.'/src/Boot/src/Bootloader/ConfigurationBootloader.php', |
|
51 | + __DIR__.'/src/Broadcasting/src/Bootloader/BroadcastingBootloader.php', |
|
52 | + __DIR__.'/src/Cache/src/Bootloader/CacheBootloader.php', |
|
53 | + __DIR__.'/src/Serializer/src/Bootloader/SerializerBootloader.php', |
|
54 | + __DIR__.'/src/Validation/src/Bootloader/ValidationBootloader.php', |
|
55 | + __DIR__.'/src/Translator/tests/IndexerTest.php', |
|
56 | + __DIR__.'/src/Tokenizer/tests/ReflectionFileTest.php', |
|
57 | + __DIR__.'/src/Core/tests/SingletonsTest.php', |
|
58 | 58 | ], |
59 | 59 | RemoveUselessVarTagRector::class => [ |
60 | - __DIR__ . '/src/Console/src/Traits/HelpersTrait.php', |
|
60 | + __DIR__.'/src/Console/src/Traits/HelpersTrait.php', |
|
61 | 61 | ], |
62 | 62 | RemoveAlwaysTrueIfConditionRector::class => [ |
63 | - __DIR__ . '/src/Boot/src/BootloadManager/Initializer.php', |
|
64 | - __DIR__ . '/src/Stempler/src/Traverser.php', |
|
65 | - __DIR__ . '/src/Prototype/src/NodeVisitors/LocateProperties.php', |
|
66 | - __DIR__ . '/src/Prototype/src/NodeVisitors/RemoveTrait.php', |
|
67 | - __DIR__ . '/src/Logger/src/ListenerRegistry.php', |
|
68 | - __DIR__ . '/src/Stempler/src/Transform/Merge/ExtendsParent.php', |
|
69 | - __DIR__ . '/src/Bridge/Stempler/src/StemplerEngine.php', |
|
63 | + __DIR__.'/src/Boot/src/BootloadManager/Initializer.php', |
|
64 | + __DIR__.'/src/Stempler/src/Traverser.php', |
|
65 | + __DIR__.'/src/Prototype/src/NodeVisitors/LocateProperties.php', |
|
66 | + __DIR__.'/src/Prototype/src/NodeVisitors/RemoveTrait.php', |
|
67 | + __DIR__.'/src/Logger/src/ListenerRegistry.php', |
|
68 | + __DIR__.'/src/Stempler/src/Transform/Merge/ExtendsParent.php', |
|
69 | + __DIR__.'/src/Bridge/Stempler/src/StemplerEngine.php', |
|
70 | 70 | ], |
71 | 71 | RemoveExtraParametersRector::class => [ |
72 | - __DIR__ . '/src/Boot/src/BootloadManager/AbstractBootloadManager.php', |
|
72 | + __DIR__.'/src/Boot/src/BootloadManager/AbstractBootloadManager.php', |
|
73 | 73 | ], |
74 | 74 | RemoveUnusedPrivateMethodParameterRector::class => [ |
75 | - __DIR__ . '/src/Core/src/Internal/Factory.php', |
|
76 | - __DIR__ . '/src/Core/tests/InjectableTest.php', |
|
75 | + __DIR__.'/src/Core/src/Internal/Factory.php', |
|
76 | + __DIR__.'/src/Core/tests/InjectableTest.php', |
|
77 | 77 | ], |
78 | 78 | RemoveDoubleAssignRector::class => [ |
79 | - __DIR__ . '/src/Core/tests/Scope/FinalizeAttributeTest.php', |
|
79 | + __DIR__.'/src/Core/tests/Scope/FinalizeAttributeTest.php', |
|
80 | 80 | ], |
81 | 81 | RemoveUnusedVariableAssignRector::class => [ |
82 | - __DIR__ . '/src/Core/tests/ExceptionsTest.php', |
|
82 | + __DIR__.'/src/Core/tests/ExceptionsTest.php', |
|
83 | 83 | ], |
84 | 84 | RemoveDeadStmtRector::class => [ |
85 | - __DIR__ . '/src/Core/tests/ExceptionsTest.php', |
|
85 | + __DIR__.'/src/Core/tests/ExceptionsTest.php', |
|
86 | 86 | ], |
87 | 87 | |
88 | 88 | // to be enabled later for bc break 4.x |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | NewInInitializerRector::class, |
93 | 93 | |
94 | 94 | // start with short open tag |
95 | - __DIR__ . '/src/Views/tests/fixtures/other/var.php', |
|
96 | - __DIR__ . '/tests/app/views/native.php', |
|
95 | + __DIR__.'/src/Views/tests/fixtures/other/var.php', |
|
96 | + __DIR__.'/tests/app/views/native.php', |
|
97 | 97 | |
98 | 98 | // example code for test |
99 | 99 | '*/Fixture/*', |
@@ -103,18 +103,18 @@ discard block |
||
103 | 103 | '*/Stubs/*', |
104 | 104 | '*/tests/Classes/*', |
105 | 105 | '*/tests/Internal/*', |
106 | - __DIR__ . '/src/Console/tests/Configurator', |
|
106 | + __DIR__.'/src/Console/tests/Configurator', |
|
107 | 107 | |
108 | 108 | // cache |
109 | 109 | '*/runtime/cache/*', |
110 | 110 | |
111 | 111 | ReadOnlyPropertyRector::class => [ |
112 | 112 | // used by Configurator |
113 | - __DIR__ . '/src/Scaffolder/src/Command', |
|
113 | + __DIR__.'/src/Scaffolder/src/Command', |
|
114 | 114 | ], |
115 | 115 | |
116 | 116 | FirstClassCallableRector::class => [ |
117 | - __DIR__ . '/src/Core/tests/Scope/UseCaseTest.php', |
|
117 | + __DIR__.'/src/Core/tests/Scope/UseCaseTest.php', |
|
118 | 118 | ], |
119 | 119 | |
120 | 120 | PreferPHPUnitThisCallRector::class, |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $logger = $factory->getLogger(); |
56 | 56 | |
57 | 57 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
58 | - new class() implements LoaderInterface { |
|
58 | + new class() implements LoaderInterface{ |
|
59 | 59 | public function has(string $section): bool |
60 | 60 | { |
61 | 61 | return false; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $factory = new LogFactory(new MonologConfig([]), new ListenerRegistry(), new Container()); |
85 | 85 | |
86 | 86 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
87 | - new class() implements LoaderInterface { |
|
87 | + new class() implements LoaderInterface{ |
|
88 | 88 | public function has(string $section): bool |
89 | 89 | { |
90 | 90 | return false; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | public function testFinalizerShouldResetDefaultLogger(): void |
112 | 112 | { |
113 | 113 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
114 | - new class() implements LoaderInterface { |
|
114 | + new class() implements LoaderInterface{ |
|
115 | 115 | public function has(string $section): bool |
116 | 116 | { |
117 | 117 | return false; |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | public function testFinalizerShouldNotResetLoggerWhenApplicationTerminating(): void |
152 | 152 | { |
153 | 153 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
154 | - new class() implements LoaderInterface { |
|
154 | + new class() implements LoaderInterface{ |
|
155 | 155 | public function has(string $section): bool |
156 | 156 | { |
157 | 157 | return false; |
@@ -55,7 +55,8 @@ discard block |
||
55 | 55 | $logger = $factory->getLogger(); |
56 | 56 | |
57 | 57 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
58 | - new class() implements LoaderInterface { |
|
58 | + new class() implements LoaderInterface |
|
59 | + { |
|
59 | 60 | public function has(string $section): bool |
60 | 61 | { |
61 | 62 | return false; |
@@ -84,7 +85,8 @@ discard block |
||
84 | 85 | $factory = new LogFactory(new MonologConfig([]), new ListenerRegistry(), new Container()); |
85 | 86 | |
86 | 87 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
87 | - new class() implements LoaderInterface { |
|
88 | + new class() implements LoaderInterface |
|
89 | + { |
|
88 | 90 | public function has(string $section): bool |
89 | 91 | { |
90 | 92 | return false; |
@@ -111,7 +113,8 @@ discard block |
||
111 | 113 | public function testFinalizerShouldResetDefaultLogger(): void |
112 | 114 | { |
113 | 115 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
114 | - new class() implements LoaderInterface { |
|
116 | + new class() implements LoaderInterface |
|
117 | + { |
|
115 | 118 | public function has(string $section): bool |
116 | 119 | { |
117 | 120 | return false; |
@@ -151,7 +154,8 @@ discard block |
||
151 | 154 | public function testFinalizerShouldNotResetLoggerWhenApplicationTerminating(): void |
152 | 155 | { |
153 | 156 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
154 | - new class() implements LoaderInterface { |
|
157 | + new class() implements LoaderInterface |
|
158 | + { |
|
155 | 159 | public function has(string $section): bool |
156 | 160 | { |
157 | 161 | return false; |
@@ -73,7 +73,7 @@ |
||
73 | 73 | $this->container->bind( |
74 | 74 | ConfiguratorInterface::class, |
75 | 75 | new ConfigManager( |
76 | - new class() implements LoaderInterface { |
|
76 | + new class() implements LoaderInterface{ |
|
77 | 77 | public function has(string $section): bool |
78 | 78 | { |
79 | 79 | return false; |
@@ -73,7 +73,8 @@ |
||
73 | 73 | $this->container->bind( |
74 | 74 | ConfiguratorInterface::class, |
75 | 75 | new ConfigManager( |
76 | - new class() implements LoaderInterface { |
|
76 | + new class() implements LoaderInterface |
|
77 | + { |
|
77 | 78 | public function has(string $section): bool |
78 | 79 | { |
79 | 80 | return false; |
@@ -26,7 +26,7 @@ |
||
26 | 26 | public function testLoggerShouldBeReset(): void |
27 | 27 | { |
28 | 28 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
29 | - new class() implements LoaderInterface { |
|
29 | + new class() implements LoaderInterface{ |
|
30 | 30 | public function has(string $section): bool |
31 | 31 | { |
32 | 32 | return false; |
@@ -26,7 +26,8 @@ |
||
26 | 26 | public function testLoggerShouldBeReset(): void |
27 | 27 | { |
28 | 28 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
29 | - new class() implements LoaderInterface { |
|
29 | + new class() implements LoaderInterface |
|
30 | + { |
|
30 | 31 | public function has(string $section): bool |
31 | 32 | { |
32 | 33 | return false; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $finalizer->shouldReceive('addFinalizer')->once(); |
28 | 28 | |
29 | 29 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
30 | - new class() implements LoaderInterface { |
|
30 | + new class() implements LoaderInterface{ |
|
31 | 31 | public function has(string $section): bool |
32 | 32 | { |
33 | 33 | return false; |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | ] |
79 | 79 | ])); |
80 | 80 | |
81 | - $logger = $this->container->get(LogsInterface::class)->getLogger('test');; |
|
81 | + $logger = $this->container->get(LogsInterface::class)->getLogger('test'); ; |
|
82 | 82 | |
83 | 83 | self::assertCount(1, $logger->getProcessors()); |
84 | 84 | self::assertInstanceOf(PsrLogMessageProcessor::class, $logger->getProcessors()[0]); |
@@ -22,22 +22,22 @@ |
||
22 | 22 | |
23 | 23 | public function loadEnvVariables(DirectoriesInterface $dirs, EnvironmentInterface $env): void |
24 | 24 | { |
25 | - if ($this->init) { |
|
25 | + if ($this->init){ |
|
26 | 26 | return; |
27 | 27 | } |
28 | 28 | |
29 | 29 | $this->init = true; |
30 | 30 | |
31 | - $dotenvPath = $env->get('DOTENV_PATH', $dirs->get('root') . '.env'); |
|
31 | + $dotenvPath = $env->get('DOTENV_PATH', $dirs->get('root').'.env'); |
|
32 | 32 | |
33 | - if (!\file_exists($dotenvPath)) { |
|
33 | + if (!\file_exists($dotenvPath)){ |
|
34 | 34 | return; |
35 | 35 | } |
36 | 36 | |
37 | - $path = \dirname((string) $dotenvPath); |
|
38 | - $file = \basename((string) $dotenvPath); |
|
37 | + $path = \dirname((string)$dotenvPath); |
|
38 | + $file = \basename((string)$dotenvPath); |
|
39 | 39 | |
40 | - foreach (Dotenv::createImmutable($path, $file)->load() as $key => $value) { |
|
40 | + foreach (Dotenv::createImmutable($path, $file)->load() as $key => $value){ |
|
41 | 41 | $env->set($key, $value); |
42 | 42 | } |
43 | 43 | } |
@@ -22,7 +22,8 @@ discard block |
||
22 | 22 | |
23 | 23 | public function loadEnvVariables(DirectoriesInterface $dirs, EnvironmentInterface $env): void |
24 | 24 | { |
25 | - if ($this->init) { |
|
25 | + if ($this->init) |
|
26 | + { |
|
26 | 27 | return; |
27 | 28 | } |
28 | 29 | |
@@ -30,14 +31,16 @@ discard block |
||
30 | 31 | |
31 | 32 | $dotenvPath = $env->get('DOTENV_PATH', $dirs->get('root') . '.env'); |
32 | 33 | |
33 | - if (!\file_exists($dotenvPath)) { |
|
34 | + if (!\file_exists($dotenvPath)) |
|
35 | + { |
|
34 | 36 | return; |
35 | 37 | } |
36 | 38 | |
37 | 39 | $path = \dirname((string) $dotenvPath); |
38 | 40 | $file = \basename((string) $dotenvPath); |
39 | 41 | |
40 | - foreach (Dotenv::createImmutable($path, $file)->load() as $key => $value) { |
|
42 | + foreach (Dotenv::createImmutable($path, $file)->load() as $key => $value) |
|
43 | + { |
|
41 | 44 | $env->set($key, $value); |
42 | 45 | } |
43 | 46 | } |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | { |
44 | 44 | $s = $this->getStempler(); |
45 | 45 | |
46 | - try { |
|
46 | + try{ |
|
47 | 47 | $s->get('echo', new ViewContext())->render(); |
48 | 48 | $this->fail('Exception expected'); |
49 | - } catch (RenderException $e) { |
|
49 | + }catch (RenderException $e){ |
|
50 | 50 | $t = $e->getUserTrace()[0]; |
51 | 51 | |
52 | 52 | self::assertSame(2, $t['line']); |
@@ -58,10 +58,10 @@ discard block |
||
58 | 58 | { |
59 | 59 | $s = $this->getStempler(); |
60 | 60 | |
61 | - try { |
|
61 | + try{ |
|
62 | 62 | $s->get('other:echo-in', new ViewContext())->render(); |
63 | 63 | $this->fail('Exception expected'); |
64 | - } catch (RenderException $e) { |
|
64 | + }catch (RenderException $e){ |
|
65 | 65 | $t = $e->getUserTrace(); |
66 | 66 | self::assertCount(2, $t); |
67 | 67 | |
@@ -77,9 +77,9 @@ discard block |
||
77 | 77 | { |
78 | 78 | $twig = $this->getStempler(); |
79 | 79 | |
80 | - try { |
|
80 | + try{ |
|
81 | 81 | $twig->get('other:bad', new ViewContext()); |
82 | - } catch (CompileException $e) { |
|
82 | + }catch (CompileException $e){ |
|
83 | 83 | self::assertStringContainsString('bad.dark.php', $e->getFile()); |
84 | 84 | } |
85 | 85 | } |
@@ -43,10 +43,13 @@ discard block |
||
43 | 43 | { |
44 | 44 | $s = $this->getStempler(); |
45 | 45 | |
46 | - try { |
|
46 | + try |
|
47 | + { |
|
47 | 48 | $s->get('echo', new ViewContext())->render(); |
48 | 49 | $this->fail('Exception expected'); |
49 | - } catch (RenderException $e) { |
|
50 | + } |
|
51 | + catch (RenderException $e) |
|
52 | + { |
|
50 | 53 | $t = $e->getUserTrace()[0]; |
51 | 54 | |
52 | 55 | self::assertSame(2, $t['line']); |
@@ -58,10 +61,13 @@ discard block |
||
58 | 61 | { |
59 | 62 | $s = $this->getStempler(); |
60 | 63 | |
61 | - try { |
|
64 | + try |
|
65 | + { |
|
62 | 66 | $s->get('other:echo-in', new ViewContext())->render(); |
63 | 67 | $this->fail('Exception expected'); |
64 | - } catch (RenderException $e) { |
|
68 | + } |
|
69 | + catch (RenderException $e) |
|
70 | + { |
|
65 | 71 | $t = $e->getUserTrace(); |
66 | 72 | self::assertCount(2, $t); |
67 | 73 | |
@@ -77,9 +83,12 @@ discard block |
||
77 | 83 | { |
78 | 84 | $twig = $this->getStempler(); |
79 | 85 | |
80 | - try { |
|
86 | + try |
|
87 | + { |
|
81 | 88 | $twig->get('other:bad', new ViewContext()); |
82 | - } catch (CompileException $e) { |
|
89 | + } |
|
90 | + catch (CompileException $e) |
|
91 | + { |
|
83 | 92 | self::assertStringContainsString('bad.dark.php', $e->getFile()); |
84 | 93 | } |
85 | 94 | } |
@@ -30,13 +30,13 @@ |
||
30 | 30 | #[TestScope("http")] |
31 | 31 | public function testCache(): void |
32 | 32 | { |
33 | - self::assertCount(0, $this->files->getFiles(__DIR__ . '/cache/', '*.php')); |
|
33 | + self::assertCount(0, $this->files->getFiles(__DIR__.'/cache/', '*.php')); |
|
34 | 34 | |
35 | 35 | $s = $this->getStempler(); |
36 | 36 | self::assertSame('test', $s->get('test', new ViewContext())->render([])); |
37 | - self::assertCount(2, $this->files->getFiles(__DIR__ . '/cache/', '*.php')); |
|
37 | + self::assertCount(2, $this->files->getFiles(__DIR__.'/cache/', '*.php')); |
|
38 | 38 | |
39 | 39 | $s->reset('test', new ViewContext()); |
40 | - self::assertCount(0, $this->files->getFiles(__DIR__ . '/../cache/', '*.php')); |
|
40 | + self::assertCount(0, $this->files->getFiles(__DIR__.'/../cache/', '*.php')); |
|
41 | 41 | } |
42 | 42 | } |
@@ -17,14 +17,14 @@ discard block |
||
17 | 17 | */ |
18 | 18 | public function renderInject(Directive $directive): string |
19 | 19 | { |
20 | - if (\count($directive->values) < 2 || (string) $directive->values[0] === '') { |
|
20 | + if (\count($directive->values) < 2 || (string)$directive->values[0] === ''){ |
|
21 | 21 | throw new DirectiveException( |
22 | 22 | 'Unable to call @inject directive, 2 values required', |
23 | 23 | $directive->getContext() |
24 | 24 | ); |
25 | 25 | } |
26 | 26 | |
27 | - if ($directive->values[0][0] === '$') { |
|
27 | + if ($directive->values[0][0] === '$'){ |
|
28 | 28 | return \sprintf( |
29 | 29 | '<?php %s = $this->container->get(%s); ?>', |
30 | 30 | $directive->values[0], |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | return \sprintf( |
36 | 36 | '<?php $%s = $this->container->get(%s); ?>', |
37 | - \trim((string) $directive->values[0], '\'"'), |
|
37 | + \trim((string)$directive->values[0], '\'"'), |
|
38 | 38 | $directive->values[1] |
39 | 39 | ); |
40 | 40 | } |