Passed
Pull Request — master (#1136)
by Abdul Malik
12:47 queued 01:07
created
src/Stempler/tests/Transform/BaseTestCase.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Queue/tests/Interceptor/Push/CoreTest.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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'],
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,7 +24,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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'],
Please login to merge, or discard this patch.
src/Boot/tests/EnvironmentTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Http/tests/HttpTest.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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',
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -89,7 +89,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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',
Please login to merge, or discard this patch.
src/Http/tests/Stream/GeneratorStreamTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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.');
Please login to merge, or discard this patch.
src/Http/tests/PipelineTest.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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,
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -60,7 +60,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Interceptors/tests/Unit/Context/TargetTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
tests/App/runtime/cache/listeners/cc3817c2bceb931d024031cc7a676edc.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1 1
 <?php return array (
2
-  0 => 'Spiral\\Tests\\Scaffolder\\App\\Command\\CommandWithoutNamespace',
3
-  1 => 'Spiral\\Tests\\Scaffolder\\App\\Command\\CommandWithNamespace',
2
+    0 => 'Spiral\\Tests\\Scaffolder\\App\\Command\\CommandWithoutNamespace',
3
+    1 => 'Spiral\\Tests\\Scaffolder\\App\\Command\\CommandWithNamespace',
4 4
 );
5 5
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php return array (
1
+<?php return array(
2 2
   0 => 'Spiral\\Tests\\Scaffolder\\App\\Command\\CommandWithoutNamespace',
3 3
   1 => 'Spiral\\Tests\\Scaffolder\\App\\Command\\CommandWithNamespace',
4 4
 );
5 5
\ No newline at end of file
Please login to merge, or discard this patch.
src/Scaffolder/tests/Command/AbstractCommandTestCase.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,11 +16,11 @@  discard block
 block discarded – undo
16 16
 
17 17
     protected function deleteDeclaration(string $class): void
18 18
     {
19
-        if (class_exists($class)) {
20
-            try {
19
+        if (class_exists($class)){
20
+            try{
21 21
                 $reflection = new ReflectionClass($class);
22 22
                 $this->files()->delete($reflection->getFileName());
23
-            } catch (Throwable $exception) {
23
+            }catch (Throwable $exception){
24 24
                 var_dump($exception->getMessage());
25 25
             }
26 26
         }
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     {
47 47
         parent::tearDown();
48 48
 
49
-        if ($this->className) {
49
+        if ($this->className){
50 50
             $this->deleteDeclaration($this->className);
51 51
         }
52 52
     }
Please login to merge, or discard this patch.
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,11 +16,15 @@  discard block
 block discarded – undo
16 16
 
17 17
     protected function deleteDeclaration(string $class): void
18 18
     {
19
-        if (class_exists($class)) {
20
-            try {
19
+        if (class_exists($class))
20
+        {
21
+            try
22
+            {
21 23
                 $reflection = new ReflectionClass($class);
22 24
                 $this->files()->delete($reflection->getFileName());
23
-            } catch (Throwable $exception) {
25
+            }
26
+            catch (Throwable $exception)
27
+            {
24 28
                 var_dump($exception->getMessage());
25 29
             }
26 30
         }
@@ -46,7 +50,8 @@  discard block
 block discarded – undo
46 50
     {
47 51
         parent::tearDown();
48 52
 
49
-        if ($this->className) {
53
+        if ($this->className)
54
+        {
50 55
             $this->deleteDeclaration($this->className);
51 56
         }
52 57
     }
Please login to merge, or discard this patch.