@@ -18,55 +18,55 @@ discard block |
||
18 | 18 | |
19 | 19 | return RectorConfig::configure() |
20 | 20 | ->withPaths([ |
21 | - __DIR__ . '/src/*/src', |
|
22 | - __DIR__ . '/src/*/tests', |
|
23 | - __DIR__ . '/tests', |
|
21 | + __DIR__.'/src/*/src', |
|
22 | + __DIR__.'/src/*/tests', |
|
23 | + __DIR__.'/tests', |
|
24 | 24 | ]) |
25 | 25 | ->withParallel() |
26 | 26 | ->withSkip([ |
27 | 27 | IfIssetToCoalescingRector::class, |
28 | 28 | RemoveUnusedPrivatePropertyRector::class => [ |
29 | - __DIR__ . '/src/Scaffolder/src/Command/BootloaderCommand.php', |
|
30 | - __DIR__ . '/src/Scaffolder/src/Command/CommandCommand.php', |
|
31 | - __DIR__ . '/src/Scaffolder/src/Command/ConfigCommand.php', |
|
32 | - __DIR__ . '/src/Scaffolder/src/Command/ControllerCommand.php', |
|
33 | - __DIR__ . '/src/Scaffolder/src/Command/FilterCommand.php', |
|
34 | - __DIR__ . '/src/Scaffolder/src/Command/JobHandlerCommand.php', |
|
35 | - __DIR__ . '/src/Scaffolder/src/Command/MiddlewareCommand.php', |
|
29 | + __DIR__.'/src/Scaffolder/src/Command/BootloaderCommand.php', |
|
30 | + __DIR__.'/src/Scaffolder/src/Command/CommandCommand.php', |
|
31 | + __DIR__.'/src/Scaffolder/src/Command/ConfigCommand.php', |
|
32 | + __DIR__.'/src/Scaffolder/src/Command/ControllerCommand.php', |
|
33 | + __DIR__.'/src/Scaffolder/src/Command/FilterCommand.php', |
|
34 | + __DIR__.'/src/Scaffolder/src/Command/JobHandlerCommand.php', |
|
35 | + __DIR__.'/src/Scaffolder/src/Command/MiddlewareCommand.php', |
|
36 | 36 | ], |
37 | 37 | RemoveUnusedPrivateMethodRector::class => [ |
38 | - __DIR__ . '/src/Boot/src/Bootloader/ConfigurationBootloader.php', |
|
39 | - __DIR__ . '/src/Broadcasting/src/Bootloader/BroadcastingBootloader.php', |
|
40 | - __DIR__ . '/src/Cache/src/Bootloader/CacheBootloader.php', |
|
41 | - __DIR__ . '/src/Serializer/src/Bootloader/SerializerBootloader.php', |
|
42 | - __DIR__ . '/src/Validation/src/Bootloader/ValidationBootloader.php', |
|
43 | - __DIR__ . '/src/Translator/tests/IndexerTest.php', |
|
44 | - __DIR__ . '/src/Tokenizer/tests/ReflectionFileTest.php', |
|
45 | - __DIR__ . '/src/Core/tests/SingletonsTest.php', |
|
38 | + __DIR__.'/src/Boot/src/Bootloader/ConfigurationBootloader.php', |
|
39 | + __DIR__.'/src/Broadcasting/src/Bootloader/BroadcastingBootloader.php', |
|
40 | + __DIR__.'/src/Cache/src/Bootloader/CacheBootloader.php', |
|
41 | + __DIR__.'/src/Serializer/src/Bootloader/SerializerBootloader.php', |
|
42 | + __DIR__.'/src/Validation/src/Bootloader/ValidationBootloader.php', |
|
43 | + __DIR__.'/src/Translator/tests/IndexerTest.php', |
|
44 | + __DIR__.'/src/Tokenizer/tests/ReflectionFileTest.php', |
|
45 | + __DIR__.'/src/Core/tests/SingletonsTest.php', |
|
46 | 46 | ], |
47 | 47 | RemoveUselessVarTagRector::class => [ |
48 | - __DIR__ . '/src/Console/src/Traits/HelpersTrait.php', |
|
48 | + __DIR__.'/src/Console/src/Traits/HelpersTrait.php', |
|
49 | 49 | ], |
50 | 50 | RemoveAlwaysTrueIfConditionRector::class => [ |
51 | - __DIR__ . '/src/Boot/src/BootloadManager/Initializer.php', |
|
52 | - __DIR__ . '/src/Stempler/src/Traverser.php', |
|
53 | - __DIR__ . '/src/Prototype/src/NodeVisitors/LocateProperties.php', |
|
54 | - __DIR__ . '/src/Prototype/src/NodeVisitors/RemoveTrait.php', |
|
55 | - __DIR__ . '/src/Logger/src/ListenerRegistry.php', |
|
56 | - __DIR__ . '/src/Stempler/src/Transform/Merge/ExtendsParent.php', |
|
51 | + __DIR__.'/src/Boot/src/BootloadManager/Initializer.php', |
|
52 | + __DIR__.'/src/Stempler/src/Traverser.php', |
|
53 | + __DIR__.'/src/Prototype/src/NodeVisitors/LocateProperties.php', |
|
54 | + __DIR__.'/src/Prototype/src/NodeVisitors/RemoveTrait.php', |
|
55 | + __DIR__.'/src/Logger/src/ListenerRegistry.php', |
|
56 | + __DIR__.'/src/Stempler/src/Transform/Merge/ExtendsParent.php', |
|
57 | 57 | ], |
58 | 58 | RemoveExtraParametersRector::class => [ |
59 | - __DIR__ . '/src/Boot/src/BootloadManager/AbstractBootloadManager.php', |
|
59 | + __DIR__.'/src/Boot/src/BootloadManager/AbstractBootloadManager.php', |
|
60 | 60 | ], |
61 | 61 | RemoveUnusedPrivateMethodParameterRector::class => [ |
62 | - __DIR__ . '/src/Core/src/Internal/Factory.php', |
|
63 | - __DIR__ . '/src/Core/tests/InjectableTest.php', |
|
62 | + __DIR__.'/src/Core/src/Internal/Factory.php', |
|
63 | + __DIR__.'/src/Core/tests/InjectableTest.php', |
|
64 | 64 | ], |
65 | 65 | RemoveDoubleAssignRector::class => [ |
66 | - __DIR__ . '/src/Core/tests/Scope/FinalizeAttributeTest.php', |
|
66 | + __DIR__.'/src/Core/tests/Scope/FinalizeAttributeTest.php', |
|
67 | 67 | ], |
68 | 68 | RemoveUnusedVariableAssignRector::class => [ |
69 | - __DIR__ . '/src/Core/tests/ExceptionsTest.php', |
|
69 | + __DIR__.'/src/Core/tests/ExceptionsTest.php', |
|
70 | 70 | ], |
71 | 71 | |
72 | 72 | // to be enabled later for bc break 4.x |
@@ -75,8 +75,8 @@ discard block |
||
75 | 75 | RemoveUnusedPromotedPropertyRector::class, |
76 | 76 | |
77 | 77 | // start with short open tag |
78 | - __DIR__ . '/src/Views/tests/fixtures/other/var.php', |
|
79 | - __DIR__ . '/tests/app/views/native.php', |
|
78 | + __DIR__.'/src/Views/tests/fixtures/other/var.php', |
|
79 | + __DIR__.'/tests/app/views/native.php', |
|
80 | 80 | |
81 | 81 | // example code for test |
82 | 82 | '*/Fixtures/*', |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | { |
28 | 28 | protected function compile(string $source, array $visitors = [], LoaderInterface $loader = null) |
29 | 29 | { |
30 | - if ($loader === null) { |
|
30 | + if ($loader === null){ |
|
31 | 31 | $loader = new StringLoader(); |
32 | 32 | $loader->set('root', $source); |
33 | 33 | } |
@@ -62,11 +62,11 @@ discard block |
||
62 | 62 | $builder->getCompiler()->addRenderer(new DynamicRenderer(new DirectiveGroup())); |
63 | 63 | $builder->getCompiler()->addRenderer(new HTMLRenderer()); |
64 | 64 | |
65 | - foreach ($this->getVisitors() as $visitor) { |
|
65 | + foreach ($this->getVisitors() as $visitor){ |
|
66 | 66 | $builder->addVisitor($visitor); |
67 | 67 | } |
68 | 68 | |
69 | - foreach ($visitors as $visitor) { |
|
69 | + foreach ($visitors as $visitor){ |
|
70 | 70 | $builder->addVisitor($visitor); |
71 | 71 | } |
72 | 72 | |
@@ -80,6 +80,6 @@ discard block |
||
80 | 80 | |
81 | 81 | protected function getFixtureLoader(): LoaderInterface |
82 | 82 | { |
83 | - return new DirectoryLoader(__DIR__ . '/../fixtures'); |
|
83 | + return new DirectoryLoader(__DIR__.'/../fixtures'); |
|
84 | 84 | } |
85 | 85 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $queue = m::mock(QueueInterface::class) |
25 | 25 | ); |
26 | 26 | |
27 | - if (!\is_array($payload)) { |
|
27 | + if (!\is_array($payload)){ |
|
28 | 28 | $this->markTestIncomplete('QueueInterface does not support non-array payloads'); |
29 | 29 | return; |
30 | 30 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $queue = m::mock(QueueInterface::class) |
47 | 47 | ); |
48 | 48 | |
49 | - if (!\is_array($payload)) { |
|
49 | + if (!\is_array($payload)){ |
|
50 | 50 | $this->markTestIncomplete('QueueInterface does not support non-array payloads'); |
51 | 51 | return; |
52 | 52 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | && $payload === ['baz' => 'baf'] |
82 | 82 | && $options->getHeader('foo') === ['bar']); |
83 | 83 | |
84 | - ContainerScope::runScope($container, function() use($core) { |
|
84 | + ContainerScope::runScope($container, function () use($core) { |
|
85 | 85 | $core->callAction('foo', 'bar', [ |
86 | 86 | 'id' => 'job-id', |
87 | 87 | 'payload' => ['baz' => 'baf'], |
@@ -24,7 +24,8 @@ discard block |
||
24 | 24 | $queue = m::mock(QueueInterface::class) |
25 | 25 | ); |
26 | 26 | |
27 | - if (!\is_array($payload)) { |
|
27 | + if (!\is_array($payload)) |
|
28 | + { |
|
28 | 29 | $this->markTestIncomplete('QueueInterface does not support non-array payloads'); |
29 | 30 | return; |
30 | 31 | } |
@@ -46,7 +47,8 @@ discard block |
||
46 | 47 | $queue = m::mock(QueueInterface::class) |
47 | 48 | ); |
48 | 49 | |
49 | - if (!\is_array($payload)) { |
|
50 | + if (!\is_array($payload)) |
|
51 | + { |
|
50 | 52 | $this->markTestIncomplete('QueueInterface does not support non-array payloads'); |
51 | 53 | return; |
52 | 54 | } |
@@ -81,7 +83,8 @@ discard block |
||
81 | 83 | && $payload === ['baz' => 'baf'] |
82 | 84 | && $options->getHeader('foo') === ['bar']); |
83 | 85 | |
84 | - ContainerScope::runScope($container, function() use($core) { |
|
86 | + ContainerScope::runScope($container, function() use($core) |
|
87 | + { |
|
85 | 88 | $core->callAction('foo', 'bar', [ |
86 | 89 | 'id' => 'job-id', |
87 | 90 | 'payload' => ['baz' => 'baf'], |
@@ -86,7 +86,7 @@ |
||
86 | 86 | /** |
87 | 87 | * @throws \Throwable |
88 | 88 | */ |
89 | - protected function getEnv(array $env, bool $overwite= true): EnvironmentInterface |
|
89 | + protected function getEnv(array $env, bool $overwite = true): EnvironmentInterface |
|
90 | 90 | { |
91 | 91 | $core = TestCore::create(['root' => __DIR__])->run(new Environment($env, $overwite)); |
92 | 92 |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | { |
15 | 15 | $core = TestCore::create([ |
16 | 16 | 'root' => __DIR__, |
17 | - 'config' => __DIR__ . '/config' |
|
17 | + 'config' => __DIR__.'/config' |
|
18 | 18 | ])->run(); |
19 | 19 | |
20 | 20 | /** @var TestConfig $config */ |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | { |
28 | 28 | $core = TestCore::create([ |
29 | 29 | 'root' => __DIR__, |
30 | - 'config' => __DIR__ . '/config', |
|
30 | + 'config' => __DIR__.'/config', |
|
31 | 31 | ])->run(); |
32 | 32 | |
33 | 33 | $configurator = $core->getContainer()->get(ConfiguratorInterface::class); |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | { |
90 | 90 | $core = $this->getCore(); |
91 | 91 | |
92 | - $core->setHandler(function ($req, $resp) { |
|
92 | + $core->setHandler(function ($req, $resp){ |
|
93 | 93 | echo 'hello!'; |
94 | 94 | |
95 | 95 | return $resp->withAddedHeader('hello', 'value'); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | { |
106 | 106 | $core = $this->getCore(); |
107 | 107 | |
108 | - $core->setHandler(function ($req, $resp) { |
|
108 | + $core->setHandler(function ($req, $resp){ |
|
109 | 109 | echo 'hello!'; |
110 | 110 | $resp->getBody()->write('world '); |
111 | 111 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | { |
123 | 123 | $core = $this->getCore(); |
124 | 124 | |
125 | - $core->setHandler(function () { |
|
125 | + $core->setHandler(function (){ |
|
126 | 126 | ob_start(); |
127 | 127 | ob_start(); |
128 | 128 | echo 'hello!'; |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | $dispatcher |
233 | 233 | ->expects(self::exactly(2)) |
234 | 234 | ->method('dispatch') |
235 | - ->with($this->callback(static fn(RequestReceived|RequestHandled $event): bool => true)); |
|
235 | + ->with($this->callback(static fn(RequestReceived | RequestHandled $event): bool => true)); |
|
236 | 236 | $this->container->bind(EventDispatcherInterface::class, $dispatcher); |
237 | 237 | |
238 | 238 | $core = $this->getCore(); |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | TraceKind::SERVER, |
290 | 290 | ) |
291 | 291 | ->willReturnCallback( |
292 | - function ($name, $callback, $attributes, $scoped, $traceKind) { |
|
292 | + function ($name, $callback, $attributes, $scoped, $traceKind){ |
|
293 | 293 | self::assertSame($attributes, [ |
294 | 294 | 'http.method' => 'GET', |
295 | 295 | 'http.url' => 'http://example.org/path', |
@@ -89,7 +89,8 @@ discard block |
||
89 | 89 | { |
90 | 90 | $core = $this->getCore(); |
91 | 91 | |
92 | - $core->setHandler(function ($req, $resp) { |
|
92 | + $core->setHandler(function ($req, $resp) |
|
93 | + { |
|
93 | 94 | echo 'hello!'; |
94 | 95 | |
95 | 96 | return $resp->withAddedHeader('hello', 'value'); |
@@ -105,7 +106,8 @@ discard block |
||
105 | 106 | { |
106 | 107 | $core = $this->getCore(); |
107 | 108 | |
108 | - $core->setHandler(function ($req, $resp) { |
|
109 | + $core->setHandler(function ($req, $resp) |
|
110 | + { |
|
109 | 111 | echo 'hello!'; |
110 | 112 | $resp->getBody()->write('world '); |
111 | 113 | |
@@ -122,7 +124,8 @@ discard block |
||
122 | 124 | { |
123 | 125 | $core = $this->getCore(); |
124 | 126 | |
125 | - $core->setHandler(function () { |
|
127 | + $core->setHandler(function () |
|
128 | + { |
|
126 | 129 | ob_start(); |
127 | 130 | ob_start(); |
128 | 131 | echo 'hello!'; |
@@ -289,7 +292,8 @@ discard block |
||
289 | 292 | TraceKind::SERVER, |
290 | 293 | ) |
291 | 294 | ->willReturnCallback( |
292 | - function ($name, $callback, $attributes, $scoped, $traceKind) { |
|
295 | + function ($name, $callback, $attributes, $scoped, $traceKind) |
|
296 | + { |
|
293 | 297 | self::assertSame($attributes, [ |
294 | 298 | 'http.method' => 'GET', |
295 | 299 | 'http.url' => 'http://example.org/path', |
@@ -99,9 +99,9 @@ discard block |
||
99 | 99 | $rValue = 'return-value'; |
100 | 100 | $stream = $this->createStream(self::DEFAULT_SEQUENCE, $rValue); |
101 | 101 | |
102 | - $result = (string) $stream; |
|
102 | + $result = (string)$stream; |
|
103 | 103 | |
104 | - $this->assertSame(self::DEFAULT_CONTENT_RESULT . $rValue, $result); |
|
104 | + $this->assertSame(self::DEFAULT_CONTENT_RESULT.$rValue, $result); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | public function testToStringWithReturnOnly(): void |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $rValue = 'return-value'; |
110 | 110 | $stream = $this->createStream([], $rValue); |
111 | 111 | |
112 | - $result = (string) $stream; |
|
112 | + $result = (string)$stream; |
|
113 | 113 | |
114 | 114 | $this->assertSame($rValue, $result); |
115 | 115 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $stream = $this->createStream(); |
120 | 120 | $stream->close(); |
121 | 121 | |
122 | - $this->assertSame('', (string) $stream); |
|
122 | + $this->assertSame('', (string)$stream); |
|
123 | 123 | |
124 | 124 | $this->expectException(RuntimeException::class); |
125 | 125 | $this->expectExceptionMessage('Unable to read stream contents.'); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | public function testMiddlewareProcessingEventShouldBeDispatched(): void |
62 | 62 | { |
63 | - $middleware = new class implements MiddlewareInterface { |
|
63 | + $middleware = new class implements MiddlewareInterface{ |
|
64 | 64 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
65 | 65 | { |
66 | 66 | return (new ResponseFactory(new HttpConfig(['headers' => []])))->createResponse(200); |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $this->container->getBinder('http') |
90 | 90 | ->bind(ServerRequestInterface::class, static fn(CurrentRequest $cr) => $cr->get()); |
91 | 91 | |
92 | - $middleware = new class implements MiddlewareInterface { |
|
92 | + $middleware = new class implements MiddlewareInterface{ |
|
93 | 93 | public function process( |
94 | 94 | ServerRequestInterface $request, |
95 | 95 | RequestHandlerInterface $handler, |
@@ -60,7 +60,8 @@ discard block |
||
60 | 60 | |
61 | 61 | public function testMiddlewareProcessingEventShouldBeDispatched(): void |
62 | 62 | { |
63 | - $middleware = new class implements MiddlewareInterface { |
|
63 | + $middleware = new class implements MiddlewareInterface |
|
64 | + { |
|
64 | 65 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
65 | 66 | { |
66 | 67 | return (new ResponseFactory(new HttpConfig(['headers' => []])))->createResponse(200); |
@@ -89,7 +90,8 @@ discard block |
||
89 | 90 | $this->container->getBinder('http') |
90 | 91 | ->bind(ServerRequestInterface::class, static fn(CurrentRequest $cr) => $cr->get()); |
91 | 92 | |
92 | - $middleware = new class implements MiddlewareInterface { |
|
93 | + $middleware = new class implements MiddlewareInterface |
|
94 | + { |
|
93 | 95 | public function process( |
94 | 96 | ServerRequestInterface $request, |
95 | 97 | RequestHandlerInterface $handler, |
@@ -107,7 +109,8 @@ discard block |
||
107 | 109 | |
108 | 110 | $this->container->runScope( |
109 | 111 | new \Spiral\Core\Scope(name: 'http'), |
110 | - function (ScopeInterface $c) use ($middleware) { |
|
112 | + function (ScopeInterface $c) use ($middleware) |
|
113 | + { |
|
111 | 114 | $request = new ServerRequest('GET', ''); |
112 | 115 | $handler = new CallableHandler(fn() => 'response', new ResponseFactory(new HttpConfig(['headers' => []]))); |
113 | 116 |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $target = Target::fromReflectionMethod($reflection, self::class); |
48 | 48 | |
49 | 49 | self::assertSame($reflection, $target->getReflection()); |
50 | - self::assertSame(self::class . '->' . __FUNCTION__, (string)$target); |
|
50 | + self::assertSame(self::class.'->'.__FUNCTION__, (string)$target); |
|
51 | 51 | self::assertNull($target->getObject()); |
52 | 52 | } |
53 | 53 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $target = Target::fromReflectionMethod($reflection, $this); |
59 | 59 | |
60 | 60 | self::assertSame($reflection, $target->getReflection()); |
61 | - self::assertSame(self::class . '->' . __FUNCTION__, (string)$target); |
|
61 | + self::assertSame(self::class.'->'.__FUNCTION__, (string)$target); |
|
62 | 62 | self::assertNotNull($target->getObject()); |
63 | 63 | } |
64 | 64 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $reflection = $target->getReflection(); |
125 | 125 | self::assertSame($hasReflection, $reflection !== null); |
126 | 126 | self::assertNull($target->getObject()); |
127 | - if ($hasReflection) { |
|
127 | + if ($hasReflection){ |
|
128 | 128 | self::assertInstanceOf(\ReflectionMethod::class, $reflection); |
129 | 129 | self::assertSame($action, $reflection->getName()); |
130 | 130 | } |