Passed
Pull Request — master (#1190)
by Aleksei
20:19 queued 07:41
created
src/Filters/tests/Model/Schema/AttributeMapperTest.php 2 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,7 +69,8 @@  discard block
 block discarded – undo
69 69
             ->andReturn(['first' => ['foo' => 'bar'], 'second' => ['foo' => 'baz']]);
70 70
 
71 71
         [$schema, $errors] = $this->mapper->map(
72
-            $filter = new class implements FilterInterface {
72
+            $filter = new class implements FilterInterface
73
+            {
73 74
                 #[Post]
74 75
                 public string $username;
75 76
 
@@ -165,7 +166,8 @@  discard block
 block discarded – undo
165 166
             ->andReturn(['first' => ['foo' => 'bar'], 'second' => ['foo' => 'baz']]);
166 167
 
167 168
         [$schema, $errors] = $this->mapper->map(
168
-            $filter = new class implements FilterInterface {
169
+            $filter = new class implements FilterInterface
170
+            {
169 171
                 #[Post]
170 172
                 public string $username;
171 173
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
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
     public function testInputAttribute(): void
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
             ->andReturn(['first' => ['foo' => 'bar'], 'second' => ['foo' => 'baz']]);
64 64
 
65 65
         [$schema, $errors] = $this->mapper->map(
66
-            $filter = new class implements FilterInterface {
66
+            $filter = new class implements FilterInterface{
67 67
                 #[Post]
68 68
                 public string $username;
69 69
 
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
             ->andReturn(['first' => ['foo' => 'bar'], 'second' => ['foo' => 'baz']]);
160 160
 
161 161
         [$schema, $errors] = $this->mapper->map(
162
-            $filter = new class implements FilterInterface {
162
+            $filter = new class implements FilterInterface{
163 163
                 #[Post]
164 164
                 public string $username;
165 165
 
Please login to merge, or discard this patch.
src/Filters/src/Model/Interceptor/PopulateDataFromEntityInterceptor.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 
25 25
         $bag = $parameters['filterBag'];
26 26
 
27
-        if ($bag->filter instanceof Filter) {
27
+        if ($bag->filter instanceof Filter){
28 28
             $bag->filter->setData($bag->entity->toArray());
29 29
         }
30 30
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,8 @@
 block discarded – undo
24 24
 
25 25
         $bag = $parameters['filterBag'];
26 26
 
27
-        if ($bag->filter instanceof Filter) {
27
+        if ($bag->filter instanceof Filter)
28
+        {
28 29
             $bag->filter->setData($bag->entity->toArray());
29 30
         }
30 31
 
Please login to merge, or discard this patch.
src/Events/src/Processor/AbstractProcessor.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
      */
17 17
     protected function getEventFromTypeDeclaration(\ReflectionMethod $method): array
18 18
     {
19
-        if ($method->getNumberOfParameters() > 1) {
19
+        if ($method->getNumberOfParameters() > 1){
20 20
             throw $this->badClassMethod($method->class, $method->getName());
21 21
         }
22 22
         $type = $method->getParameters()[0]->getType();
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
         };
30 30
 
31 31
         $result = [];
32
-        foreach ($eventTypes as $type) {
33
-            if ($type->isBuiltin()) {
32
+        foreach ($eventTypes as $type){
33
+            if ($type->isBuiltin()){
34 34
                 continue;
35 35
             }
36 36
             $result[] = $type->getName();
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
      */
45 45
     protected function getMethod(string $class, string $name): \ReflectionMethod
46 46
     {
47
-        try {
47
+        try{
48 48
             return new \ReflectionMethod($class, $name);
49
-        } catch (\ReflectionException) {
49
+        }catch (\ReflectionException){
50 50
             throw $this->badClassMethod($class, $name);
51 51
         }
52 52
     }
Please login to merge, or discard this patch.
Braces   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,7 +16,8 @@  discard block
 block discarded – undo
16 16
      */
17 17
     protected function getEventFromTypeDeclaration(\ReflectionMethod $method): array
18 18
     {
19
-        if ($method->getNumberOfParameters() > 1) {
19
+        if ($method->getNumberOfParameters() > 1)
20
+        {
20 21
             throw $this->badClassMethod($method->class, $method->getName());
21 22
         }
22 23
         $type = $method->getParameters()[0]->getType();
@@ -29,8 +30,10 @@  discard block
 block discarded – undo
29 30
         };
30 31
 
31 32
         $result = [];
32
-        foreach ($eventTypes as $type) {
33
-            if ($type->isBuiltin()) {
33
+        foreach ($eventTypes as $type)
34
+        {
35
+            if ($type->isBuiltin())
36
+            {
34 37
                 continue;
35 38
             }
36 39
             $result[] = $type->getName();
@@ -44,9 +47,12 @@  discard block
 block discarded – undo
44 47
      */
45 48
     protected function getMethod(string $class, string $name): \ReflectionMethod
46 49
     {
47
-        try {
50
+        try
51
+        {
48 52
             return new \ReflectionMethod($class, $name);
49
-        } catch (\ReflectionException) {
53
+        }
54
+        catch (\ReflectionException)
55
+        {
50 56
             throw $this->badClassMethod($class, $name);
51 57
         }
52 58
     }
Please login to merge, or discard this patch.
src/Events/src/ListenerProcessorRegistry.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,11 +20,11 @@
 block discarded – undo
20 20
 
21 21
     public function process(): void
22 22
     {
23
-        if ($this->processed) {
23
+        if ($this->processed){
24 24
             return;
25 25
         }
26 26
 
27
-        foreach ($this->processors as $processor) {
27
+        foreach ($this->processors as $processor){
28 28
             $processor->process();
29 29
         }
30 30
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,11 +20,13 @@
 block discarded – undo
20 20
 
21 21
     public function process(): void
22 22
     {
23
-        if ($this->processed) {
23
+        if ($this->processed)
24
+        {
24 25
             return;
25 26
         }
26 27
 
27
-        foreach ($this->processors as $processor) {
28
+        foreach ($this->processors as $processor)
29
+        {
28 30
             $processor->process();
29 31
         }
30 32
 
Please login to merge, or discard this patch.
src/Events/src/ListenerFactoryInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,5 +11,5 @@
 block discarded – undo
11 11
      * @return \Closure(object $event): void
12 12
      * @throws \BadMethodCallException
13 13
      */
14
-    public function create(string|object $listener, string $method): \Closure;
14
+    public function create(string | object $listener, string $method): \Closure;
15 15
 }
Please login to merge, or discard this patch.
src/Events/src/AutowireListenerFactory.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@  discard block
 block discarded – undo
9 9
 
10 10
 final class AutowireListenerFactory implements ListenerFactoryInterface
11 11
 {
12
-    public function create(string|object $listener, string $method): \Closure
12
+    public function create(string | object $listener, string $method): \Closure
13 13
     {
14
-        if ($this->listenerShouldBeAutowired($listener, $method)) {
14
+        if ($this->listenerShouldBeAutowired($listener, $method)){
15 15
             return static function (object $event) use ($listener, $method): void {
16 16
                 ContainerScope::getContainer()
17 17
                     ->get(InvokerInterface::class)
@@ -30,26 +30,26 @@  discard block
 block discarded – undo
30 30
      *
31 31
      * @return TClass
32 32
      */
33
-    private static function getListener(string|object $listener): object
33
+    private static function getListener(string | object $listener): object
34 34
     {
35
-        if (\is_object($listener)) {
35
+        if (\is_object($listener)){
36 36
             return $listener;
37 37
         }
38 38
 
39 39
         return ContainerScope::getContainer()->get($listener);
40 40
     }
41 41
 
42
-    private function listenerShouldBeAutowired(object|string $listener, string $method): bool
42
+    private function listenerShouldBeAutowired(object | string $listener, string $method): bool
43 43
     {
44
-        if (!\is_object($listener) && !\class_exists($listener) && !\interface_exists($listener)) {
44
+        if (!\is_object($listener) && !\class_exists($listener) && !\interface_exists($listener)){
45 45
             return true;
46 46
         }
47 47
 
48
-        try {
48
+        try{
49 49
             $refMethod = new \ReflectionMethod($listener, $method);
50 50
 
51 51
             return $refMethod->getNumberOfParameters() > 1;
52
-        } catch (\ReflectionException $e) {
52
+        }catch (\ReflectionException $e){
53 53
             $listener = \is_object($listener) ? $listener::class : $listener;
54 54
 
55 55
             throw match (true) {
Please login to merge, or discard this patch.
Braces   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,7 +11,8 @@  discard block
 block discarded – undo
11 11
 {
12 12
     public function create(string|object $listener, string $method): \Closure
13 13
     {
14
-        if ($this->listenerShouldBeAutowired($listener, $method)) {
14
+        if ($this->listenerShouldBeAutowired($listener, $method))
15
+        {
15 16
             return static function (object $event) use ($listener, $method): void {
16 17
                 ContainerScope::getContainer()
17 18
                     ->get(InvokerInterface::class)
@@ -32,7 +33,8 @@  discard block
 block discarded – undo
32 33
      */
33 34
     private static function getListener(string|object $listener): object
34 35
     {
35
-        if (\is_object($listener)) {
36
+        if (\is_object($listener))
37
+        {
36 38
             return $listener;
37 39
         }
38 40
 
@@ -41,15 +43,19 @@  discard block
 block discarded – undo
41 43
 
42 44
     private function listenerShouldBeAutowired(object|string $listener, string $method): bool
43 45
     {
44
-        if (!\is_object($listener) && !\class_exists($listener) && !\interface_exists($listener)) {
46
+        if (!\is_object($listener) && !\class_exists($listener) && !\interface_exists($listener))
47
+        {
45 48
             return true;
46 49
         }
47 50
 
48
-        try {
51
+        try
52
+        {
49 53
             $refMethod = new \ReflectionMethod($listener, $method);
50 54
 
51 55
             return $refMethod->getNumberOfParameters() > 1;
52
-        } catch (\ReflectionException $e) {
56
+        }
57
+        catch (\ReflectionException $e)
58
+        {
53 59
             $listener = \is_object($listener) ? $listener::class : $listener;
54 60
 
55 61
             throw match (true) {
Please login to merge, or discard this patch.
src/Stempler/tests/BufferTest.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     public function testIterate(): void
26 26
     {
27 27
         $out = '';
28
-        foreach ($this->buffer('abc') as $n) {
28
+        foreach ($this->buffer('abc') as $n){
29 29
             $out .= $n->char;
30 30
         }
31 31
 
@@ -149,14 +149,14 @@  discard block
 block discarded – undo
149 149
 
150 150
     private function generate(StreamInterface $src)
151 151
     {
152
-        while (!$src->isEOI()) {
152
+        while (!$src->isEOI()){
153 153
             yield new Byte($src->getOffset(), $src->peak());
154 154
         }
155 155
     }
156 156
 
157 157
     private function generateToken(StreamInterface $src): \Generator
158 158
     {
159
-        while (!$src->isEOI()) {
159
+        while (!$src->isEOI()){
160 160
             yield new Token(0, null, $src->peak());
161 161
         }
162 162
     }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,7 +25,8 @@  discard block
 block discarded – undo
25 25
     public function testIterate(): void
26 26
     {
27 27
         $out = '';
28
-        foreach ($this->buffer('abc') as $n) {
28
+        foreach ($this->buffer('abc') as $n)
29
+        {
29 30
             $out .= $n->char;
30 31
         }
31 32
 
@@ -149,14 +150,16 @@  discard block
 block discarded – undo
149 150
 
150 151
     private function generate(StreamInterface $src)
151 152
     {
152
-        while (!$src->isEOI()) {
153
+        while (!$src->isEOI())
154
+        {
153 155
             yield new Byte($src->getOffset(), $src->peak());
154 156
         }
155 157
     }
156 158
 
157 159
     private function generateToken(StreamInterface $src): \Generator
158 160
     {
159
-        while (!$src->isEOI()) {
161
+        while (!$src->isEOI())
162
+        {
160 163
             yield new Token(0, null, $src->peak());
161 164
         }
162 165
     }
Please login to merge, or discard this patch.
src/Framework/Filter/ValidationHandlerMiddleware.php 2 patches
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,9 +33,12 @@
 block discarded – undo
33 33
 
34 34
     public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
35 35
     {
36
-        try {
36
+        try
37
+        {
37 38
             return $handler->handle($request);
38
-        } catch (ValidationException $e) {
39
+        }
40
+        catch (ValidationException $e)
41
+        {
39 42
             return $this->renderErrors->render($e->errors, $e->context);
40 43
         }
41 44
     }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,15 +27,15 @@
 block discarded – undo
27 27
     public function __construct(
28 28
         ContainerInterface $container,
29 29
         ?ErrorsRendererInterface $renderErrors = null,
30
-    ) {
30
+    ){
31 31
         $this->renderErrors = $renderErrors ?? $container->get(JsonErrorsRenderer::class);
32 32
     }
33 33
 
34 34
     public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
35 35
     {
36
-        try {
36
+        try{
37 37
             return $handler->handle($request);
38
-        } catch (ValidationException $e) {
38
+        }catch (ValidationException $e){
39 39
             return $this->renderErrors->render($e->errors, $e->context);
40 40
         }
41 41
     }
Please login to merge, or discard this patch.
src/Queue/src/Options.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -107,14 +107,14 @@  discard block
 block discarded – undo
107 107
      * @param non-empty-string $name
108 108
      * @param non-empty-string|array<non-empty-string> $value
109 109
      */
110
-    public function withHeader(string $name, string|array $value): self
110
+    public function withHeader(string $name, string | array $value): self
111 111
     {
112 112
         $value = \is_iterable($value) ? $value : [$value];
113 113
 
114 114
         $self = clone $this;
115 115
         $self->headers[$name] = [];
116 116
 
117
-        foreach ($value as $item) {
117
+        foreach ($value as $item){
118 118
             $self->headers[$name][] = $item;
119 119
         }
120 120
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
      * @param non-empty-string $name
126 126
      * @param non-empty-string|array<non-empty-string> $value
127 127
      */
128
-    public function withAddedHeader(string $name, string|array $value): self
128
+    public function withAddedHeader(string $name, string | array $value): self
129 129
     {
130 130
         /** @var iterable<non-empty-string> $value */
131 131
         $value = \is_iterable($value) ? $value : [$value];
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         /** @var array<non-empty-string> $headers */
134 134
         $headers = $this->headers[$name] ?? [];
135 135
 
136
-        foreach ($value as $item) {
136
+        foreach ($value as $item){
137 137
             $headers[] = $item;
138 138
         }
139 139
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
      */
146 146
     public function withoutHeader(string $name): self
147 147
     {
148
-        if (!isset($this->headers[$name])) {
148
+        if (!isset($this->headers[$name])){
149 149
             return $this;
150 150
         }
151 151
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -114,7 +114,8 @@  discard block
 block discarded – undo
114 114
         $self = clone $this;
115 115
         $self->headers[$name] = [];
116 116
 
117
-        foreach ($value as $item) {
117
+        foreach ($value as $item)
118
+        {
118 119
             $self->headers[$name][] = $item;
119 120
         }
120 121
 
@@ -133,7 +134,8 @@  discard block
 block discarded – undo
133 134
         /** @var array<non-empty-string> $headers */
134 135
         $headers = $this->headers[$name] ?? [];
135 136
 
136
-        foreach ($value as $item) {
137
+        foreach ($value as $item)
138
+        {
137 139
             $headers[] = $item;
138 140
         }
139 141
 
@@ -145,7 +147,8 @@  discard block
 block discarded – undo
145 147
      */
146 148
     public function withoutHeader(string $name): self
147 149
     {
148
-        if (!isset($this->headers[$name])) {
150
+        if (!isset($this->headers[$name]))
151
+        {
149 152
             return $this;
150 153
         }
151 154
 
Please login to merge, or discard this patch.