Passed
Push — master ( c81bf2...c3afe7 )
by Aleksei
09:08 queued 01:17
created
src/Serializer/src/SerializerInterface.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 
7 7
 interface SerializerInterface
8 8
 {
9
-    public function serialize(mixed $payload): string|\Stringable;
9
+    public function serialize(mixed $payload): string | \Stringable;
10 10
 
11
-    public function unserialize(string|\Stringable $payload, string|object|null $type = null): mixed;
11
+    public function unserialize(string | \Stringable $payload, string | object | null $type = null): mixed;
12 12
 }
Please login to merge, or discard this patch.
src/Serializer/src/SerializerRegistry.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 
14 14
     public function __construct(array $serializers = [])
15 15
     {
16
-        foreach ($serializers as $name => $serializer) {
16
+        foreach ($serializers as $name => $serializer){
17 17
             $this->register($name, $serializer);
18 18
         }
19 19
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,8 @@
 block discarded – undo
13 13
 
14 14
     public function __construct(array $serializers = [])
15 15
     {
16
-        foreach ($serializers as $name => $serializer) {
16
+        foreach ($serializers as $name => $serializer)
17
+        {
17 18
             $this->register($name, $serializer);
18 19
         }
19 20
     }
Please login to merge, or discard this patch.
src/Config/src/Loader/DirectoryLoader.php 2 patches
Braces   +13 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,9 +23,11 @@  discard block
 block discarded – undo
23 23
 
24 24
     public function has(string $section): bool
25 25
     {
26
-        foreach ($this->loaderExtensions() as $extension) {
26
+        foreach ($this->loaderExtensions() as $extension)
27
+        {
27 28
             $filename = \sprintf('%s/%s.%s', $this->directory, $section, $extension);
28
-            if (\file_exists($filename)) {
29
+            if (\file_exists($filename))
30
+            {
29 31
                 return true;
30 32
             }
31 33
         }
@@ -35,15 +37,20 @@  discard block
 block discarded – undo
35 37
 
36 38
     public function load(string $section): array
37 39
     {
38
-        foreach ($this->loaderExtensions() as $extension) {
40
+        foreach ($this->loaderExtensions() as $extension)
41
+        {
39 42
             $filename = \sprintf('%s/%s.%s', $this->directory, $section, $extension);
40
-            if (!\file_exists($filename)) {
43
+            if (!\file_exists($filename))
44
+            {
41 45
                 continue;
42 46
             }
43 47
 
44
-            try {
48
+            try
49
+            {
45 50
                 return $this->getLoader($extension)->loadFile($section, $filename);
46
-            } catch (LoaderException $e) {
51
+            }
52
+            catch (LoaderException $e)
53
+            {
47 54
                 throw new LoaderException("Unable to load config `{$section}`: {$e->getMessage()}", $e->getCode(), $e);
48 55
             }
49 56
         }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -17,15 +17,15 @@  discard block
 block discarded – undo
17 17
     public function __construct(
18 18
         string $directory,
19 19
         private readonly array $loaders = [],
20
-    ) {
20
+    ){
21 21
         $this->directory = \rtrim($directory, '/');
22 22
     }
23 23
 
24 24
     public function has(string $section): bool
25 25
     {
26
-        foreach ($this->loaderExtensions() as $extension) {
26
+        foreach ($this->loaderExtensions() as $extension){
27 27
             $filename = \sprintf('%s/%s.%s', $this->directory, $section, $extension);
28
-            if (\file_exists($filename)) {
28
+            if (\file_exists($filename)){
29 29
                 return true;
30 30
             }
31 31
         }
@@ -35,15 +35,15 @@  discard block
 block discarded – undo
35 35
 
36 36
     public function load(string $section): array
37 37
     {
38
-        foreach ($this->loaderExtensions() as $extension) {
38
+        foreach ($this->loaderExtensions() as $extension){
39 39
             $filename = \sprintf('%s/%s.%s', $this->directory, $section, $extension);
40
-            if (!\file_exists($filename)) {
40
+            if (!\file_exists($filename)){
41 41
                 continue;
42 42
             }
43 43
 
44
-            try {
44
+            try{
45 45
                 return $this->getLoader($extension)->loadFile($section, $filename);
46
-            } catch (LoaderException $e) {
46
+            }catch (LoaderException $e){
47 47
                 throw new LoaderException("Unable to load config `{$section}`: {$e->getMessage()}", $e->getCode(), $e);
48 48
             }
49 49
         }
Please login to merge, or discard this patch.
src/Config/src/Loader/JsonLoader.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
         $content = \file_get_contents($filename);
14 14
         $data = \json_decode($content, true);
15 15
 
16
-        if (\is_null($data)) {
16
+        if (\is_null($data)){
17 17
             throw new LoaderException(\json_last_error_msg(), \json_last_error());
18 18
         }
19 19
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,8 @@
 block discarded – undo
13 13
         $content = \file_get_contents($filename);
14 14
         $data = \json_decode($content, true);
15 15
 
16
-        if (\is_null($data)) {
16
+        if (\is_null($data))
17
+        {
17 18
             throw new LoaderException(\json_last_error_msg(), \json_last_error());
18 19
         }
19 20
 
Please login to merge, or discard this patch.
src/Config/src/Patch/Delete.php 2 patches
Braces   +14 added lines, -6 removed lines patch added patch discarded remove patch
@@ -24,20 +24,28 @@
 block discarded – undo
24 24
 
25 25
     public function patch(array $config): array
26 26
     {
27
-        try {
27
+        try
28
+        {
28 29
             $target = &$this->dotGet($config, $this->position);
29 30
 
30
-            if ($this->key !== null) {
31
+            if ($this->key !== null)
32
+            {
31 33
                 unset($target[$this->key]);
32
-            } else {
33
-                foreach ($target as $key => $value) {
34
-                    if ($value === $this->value) {
34
+            }
35
+            else
36
+            {
37
+                foreach ($target as $key => $value)
38
+                {
39
+                    if ($value === $this->value)
40
+                    {
35 41
                         unset($target[$key]);
36 42
                         break;
37 43
                     }
38 44
                 }
39 45
             }
40
-        } catch (DotNotFoundException) {
46
+        }
47
+        catch (DotNotFoundException)
48
+        {
41 49
             // doing nothing when section not found
42 50
         }
43 51
 
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -18,26 +18,26 @@
 block discarded – undo
18 18
         string $position,
19 19
         private readonly ?string $key,
20 20
         private mixed $value = null,
21
-    ) {
21
+    ){
22 22
         $this->position = $position === '.' ? '' : $position;
23 23
     }
24 24
 
25 25
     public function patch(array $config): array
26 26
     {
27
-        try {
27
+        try{
28 28
             $target = &$this->dotGet($config, $this->position);
29 29
 
30
-            if ($this->key !== null) {
30
+            if ($this->key !== null){
31 31
                 unset($target[$this->key]);
32
-            } else {
33
-                foreach ($target as $key => $value) {
34
-                    if ($value === $this->value) {
32
+            }else{
33
+                foreach ($target as $key => $value){
34
+                    if ($value === $this->value){
35 35
                         unset($target[$key]);
36 36
                         break;
37 37
                     }
38 38
                 }
39 39
             }
40
-        } catch (DotNotFoundException) {
40
+        }catch (DotNotFoundException){
41 41
             // doing nothing when section not found
42 42
         }
43 43
 
Please login to merge, or discard this patch.
src/Config/src/Patch/Traits/DotTrait.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,14 +14,14 @@
 block discarded – undo
14 14
     private function &dotGet(array &$data, string $name): mixed
15 15
     {
16 16
         //Generating path relative to a given name and prefix
17
-        $path = (!empty($this->prefix) ? $this->prefix . '.' : '') . $name;
18
-        if (empty($path)) {
17
+        $path = (!empty($this->prefix) ? $this->prefix.'.' : '').$name;
18
+        if (empty($path)){
19 19
             return $data;
20 20
         }
21 21
 
22 22
         $path = \explode('.', \rtrim($path, '.'));
23
-        foreach ($path as $step) {
24
-            if (!\is_array($data) || !\array_key_exists($step, $data)) {
23
+        foreach ($path as $step){
24
+            if (!\is_array($data) || !\array_key_exists($step, $data)){
25 25
                 throw new DotNotFoundException(\sprintf("Unable to find config element '%s'.", $name));
26 26
             }
27 27
             $data = &$data[$step];
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,13 +15,16 @@
 block discarded – undo
15 15
     {
16 16
         //Generating path relative to a given name and prefix
17 17
         $path = (!empty($this->prefix) ? $this->prefix . '.' : '') . $name;
18
-        if (empty($path)) {
18
+        if (empty($path))
19
+        {
19 20
             return $data;
20 21
         }
21 22
 
22 23
         $path = \explode('.', \rtrim($path, '.'));
23
-        foreach ($path as $step) {
24
-            if (!\is_array($data) || !\array_key_exists($step, $data)) {
24
+        foreach ($path as $step)
25
+        {
26
+            if (!\is_array($data) || !\array_key_exists($step, $data))
27
+            {
25 28
                 throw new DotNotFoundException(\sprintf("Unable to find config element '%s'.", $name));
26 29
             }
27 30
             $data = &$data[$step];
Please login to merge, or discard this patch.
src/Config/src/Patch/Append.php 2 patches
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,15 +25,21 @@
 block discarded – undo
25 25
 
26 26
     public function patch(array $config): array
27 27
     {
28
-        try {
28
+        try
29
+        {
29 30
             $target = &$this->dotGet($config, $this->position);
30 31
 
31
-            if ($this->key !== null) {
32
+            if ($this->key !== null)
33
+            {
32 34
                 $target[$this->key] = $this->value;
33
-            } else {
35
+            }
36
+            else
37
+            {
34 38
                 $target[] = $this->value;
35 39
             }
36
-        } catch (DotNotFoundException $e) {
40
+        }
41
+        catch (DotNotFoundException $e)
42
+        {
37 43
             throw new PatchException($e->getMessage(), $e->getCode(), $e);
38 44
         }
39 45
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -19,21 +19,21 @@
 block discarded – undo
19 19
         string $position,
20 20
         private ?string $key,
21 21
         private mixed $value,
22
-    ) {
22
+    ){
23 23
         $this->position = $position === '.' ? '' : $position;
24 24
     }
25 25
 
26 26
     public function patch(array $config): array
27 27
     {
28
-        try {
28
+        try{
29 29
             $target = &$this->dotGet($config, $this->position);
30 30
 
31
-            if ($this->key !== null) {
31
+            if ($this->key !== null){
32 32
                 $target[$this->key] = $this->value;
33
-            } else {
33
+            }else{
34 34
                 $target[] = $this->value;
35 35
             }
36
-        } catch (DotNotFoundException $e) {
36
+        }catch (DotNotFoundException $e){
37 37
             throw new PatchException($e->getMessage(), $e->getCode(), $e);
38 38
         }
39 39
 
Please login to merge, or discard this patch.
src/Router/src/Traits/VerbsTrait.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@
 block discarded – undo
19 19
      */
20 20
     public function withVerbs(string ...$verbs): RouteInterface
21 21
     {
22
-        foreach ($verbs as &$verb) {
22
+        foreach ($verbs as &$verb){
23 23
             $verb = \strtoupper($verb);
24
-            if (!\in_array($verb, RouteInterface::VERBS, true)) {
24
+            if (!\in_array($verb, RouteInterface::VERBS, true)){
25 25
                 throw new RouteException(\sprintf('Invalid HTTP verb `%s`', $verb));
26 26
             }
27 27
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,9 +19,11 @@
 block discarded – undo
19 19
      */
20 20
     public function withVerbs(string ...$verbs): RouteInterface
21 21
     {
22
-        foreach ($verbs as &$verb) {
22
+        foreach ($verbs as &$verb)
23
+        {
23 24
             $verb = \strtoupper($verb);
24
-            if (!\in_array($verb, RouteInterface::VERBS, true)) {
25
+            if (!\in_array($verb, RouteInterface::VERBS, true))
26
+            {
25 27
                 throw new RouteException(\sprintf('Invalid HTTP verb `%s`', $verb));
26 28
             }
27 29
 
Please login to merge, or discard this patch.
src/Cookies/src/Cookie/SameSite.php 3 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,12 +27,12 @@
 block discarded – undo
27 27
 
28 28
     private function defineValue(?string $sameSite, bool $secure): ?string
29 29
     {
30
-        if ($sameSite === null) {
30
+        if ($sameSite === null){
31 31
             return null;
32 32
         }
33 33
 
34 34
         $sameSite = \ucfirst(\strtolower($sameSite));
35
-        if (!\in_array($sameSite, self::VALUES, true)) {
35
+        if (!\in_array($sameSite, self::VALUES, true)){
36 36
             return null;
37 37
         }
38 38
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,12 +27,14 @@
 block discarded – undo
27 27
 
28 28
     private function defineValue(?string $sameSite, bool $secure): ?string
29 29
     {
30
-        if ($sameSite === null) {
30
+        if ($sameSite === null)
31
+        {
31 32
             return null;
32 33
         }
33 34
 
34 35
         $sameSite = \ucfirst(\strtolower($sameSite));
35
-        if (!\in_array($sameSite, self::VALUES, true)) {
36
+        if (!\in_array($sameSite, self::VALUES, true))
37
+        {
36 38
             return null;
37 39
         }
38 40
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
     public const LAX    = 'Lax';
11 11
     public const NONE   = 'None';
12 12
     private const VALUES  = [self::STRICT, self::LAX, self::NONE];
13
-    private const DEFAULT = self::LAX;
13
+    private const default = self::LAX;
14 14
 
15 15
     private ?string $sameSite = null;
16 16
 
@@ -35,6 +35,6 @@  discard block
 block discarded – undo
35 35
             return null;
36 36
         }
37 37
 
38
-        return ($sameSite === self::NONE && !$secure) ? self::DEFAULT : $sameSite;
38
+        return ($sameSite === self::NONE && !$secure) ? self::default : $sameSite;
39 39
     }
40 40
 }
Please login to merge, or discard this patch.