Passed
Pull Request — master (#1207)
by Aleksei
10:55
created
src/Http/src/Request/HeadersBag.php 2 patches
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,7 +22,8 @@  discard block
 block discarded – undo
22 22
     {
23 23
         $value = parent::get($this->normalize((string) $name), $default);
24 24
 
25
-        if (\is_string($implode) && !empty($implode) && \is_array($value)) {
25
+        if (\is_string($implode) && !empty($implode) && \is_array($value))
26
+        {
26 27
             return \implode($implode, $value);
27 28
         }
28 29
 
@@ -38,8 +39,10 @@  discard block
 block discarded – undo
38 39
 
39 40
         $values = parent::fetch($keys, $fill, $filler);
40 41
 
41
-        if (!empty($implode)) {
42
-            foreach ($values as &$value) {
42
+        if (!empty($implode))
43
+        {
44
+            foreach ($values as &$value)
45
+            {
43 46
                 $value = \implode($implode, $value);
44 47
                 unset($value);
45 48
             }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -10,19 +10,19 @@  discard block
 block discarded – undo
10 10
  */
11 11
 final class HeadersBag extends InputBag
12 12
 {
13
-    public function has(int|string $name): bool
13
+    public function has(int | string $name): bool
14 14
     {
15
-        return parent::has($this->normalize((string) $name));
15
+        return parent::has($this->normalize((string)$name));
16 16
     }
17 17
 
18 18
     /**
19 19
      * @param false|string $implode Implode header lines, false to return header as array.
20 20
      */
21
-    public function get(int|string $name, mixed $default = null, bool|string $implode = ','): array|string|null
21
+    public function get(int | string $name, mixed $default = null, bool | string $implode = ','): array | string | null
22 22
     {
23
-        $value = parent::get($this->normalize((string) $name), $default);
23
+        $value = parent::get($this->normalize((string)$name), $default);
24 24
 
25
-        if (\is_string($implode) && !empty($implode) && \is_array($value)) {
25
+        if (\is_string($implode) && !empty($implode) && \is_array($value)){
26 26
             return \implode($implode, $value);
27 27
         }
28 28
 
@@ -34,12 +34,12 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function fetch(array $keys, bool $fill = false, mixed $filler = null, ?string $implode = ','): array
36 36
     {
37
-        $keys = \array_map(fn(string $header): string => $this->normalize($header), $keys);
37
+        $keys = \array_map(fn(string $header) : string => $this->normalize($header), $keys);
38 38
 
39 39
         $values = parent::fetch($keys, $fill, $filler);
40 40
 
41
-        if (!empty($implode)) {
42
-            foreach ($values as &$value) {
41
+        if (!empty($implode)){
42
+            foreach ($values as &$value){
43 43
                 $value = \implode($implode, $value);
44 44
                 unset($value);
45 45
             }
Please login to merge, or discard this patch.
src/SendIt/src/Bootloader/BuilderBootloader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,6 +25,6 @@
 block discarded – undo
25 25
 
26 26
     public function init(ViewsBootloader $views): void
27 27
     {
28
-        $views->addDirectory('sendit', __DIR__ . '/../../views');
28
+        $views->addDirectory('sendit', __DIR__.'/../../views');
29 29
     }
30 30
 }
Please login to merge, or discard this patch.
src/AuthHttp/src/TransportRegistry.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
     {
30 30
         $name ??= $this->default;
31 31
 
32
-        if (!isset($this->transports[$name])) {
32
+        if (!isset($this->transports[$name])){
33 33
             throw new TransportException(\sprintf('Undefined auth transport %s', $name));
34 34
         }
35 35
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,8 @@
 block discarded – undo
29 29
     {
30 30
         $name ??= $this->default;
31 31
 
32
-        if (!isset($this->transports[$name])) {
32
+        if (!isset($this->transports[$name]))
33
+        {
33 34
             throw new TransportException(\sprintf('Undefined auth transport %s', $name));
34 35
         }
35 36
 
Please login to merge, or discard this patch.
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.