Passed
Pull Request — master (#1221)
by Aleksei
12:41
created
src/Core/src/Exception/Resolver/WrongTypeException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
     {
11 11
         $message = 'An argument resolved with wrong type: ';
12 12
         parent::__construct(
13
-            $message . $error->getMessage(),
13
+            $message.$error->getMessage(),
14 14
             $error->getCode(),
15 15
             $error,
16 16
         );
Please login to merge, or discard this patch.
src/Core/src/Exception/Resolver/InvalidArgumentException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
     public function __construct(
14 14
         \ReflectionFunctionAbstract $reflection,
15 15
         private readonly string $parameter,
16
-    ) {
16
+    ){
17 17
         $pattern = "Invalid argument value type for the `$parameter` parameter when validating arguments for `%s`.";
18 18
         parent::__construct($this->renderFunctionAndParameter($reflection, $pattern));
19 19
     }
Please login to merge, or discard this patch.
src/Core/src/Exception/Resolver/ResolvingException.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,4 +6,4 @@
 block discarded – undo
6 6
 
7 7
 use Spiral\Core\Exception\Container\ContainerException;
8 8
 
9
-class ResolvingException extends ContainerException {}
9
+class ResolvingException extends ContainerException{}
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,4 +6,6 @@
 block discarded – undo
6 6
 
7 7
 use Spiral\Core\Exception\Container\ContainerException;
8 8
 
9
-class ResolvingException extends ContainerException {}
9
+class ResolvingException extends ContainerException
10
+{
11
+}
Please login to merge, or discard this patch.
src/Core/src/Exception/Resolver/PositionalArgumentException.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,13 +13,13 @@
 block discarded – undo
13 13
     public function __construct(
14 14
         \ReflectionFunctionAbstract $reflection,
15 15
         private readonly int $position,
16
-    ) {
16
+    ){
17 17
         $pattern = 'Cannot use positional argument after named argument `%s` %s.';
18 18
         parent::__construct($this->renderFunctionAndParameter($reflection, $pattern));
19 19
     }
20 20
 
21 21
     public function getParameter(): string
22 22
     {
23
-        return '#' . $this->position;
23
+        return '#'.$this->position;
24 24
     }
25 25
 }
Please login to merge, or discard this patch.
src/Core/src/Exception/Resolver/UnknownParameterException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
     public function __construct(
14 14
         \ReflectionFunctionAbstract $reflection,
15 15
         private readonly string $parameter,
16
-    ) {
16
+    ){
17 17
         $pattern = "Unknown named parameter `{$parameter}` `%s` %s.";
18 18
         parent::__construct($this->renderFunctionAndParameter($reflection, $pattern));
19 19
     }
Please login to merge, or discard this patch.
src/Core/src/Exception/Resolver/ArgumentResolvingException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
     public function __construct(
14 14
         \ReflectionFunctionAbstract $reflection,
15 15
         private readonly string $parameter,
16
-    ) {
16
+    ){
17 17
         $pattern = "Unable to resolve required argument `{$parameter}` when resolving `%s` %s.";
18 18
         parent::__construct($this->renderFunctionAndParameter($reflection, $pattern));
19 19
     }
Please login to merge, or discard this patch.
src/Core/src/Exception/Resolver/MissingRequiredArgumentException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
     public function __construct(
14 14
         \ReflectionFunctionAbstract $reflection,
15 15
         private readonly string $parameter,
16
-    ) {
16
+    ){
17 17
         $pattern = "Missing required argument for the `{$parameter}` parameter for `%s` %s.";
18 18
         parent::__construct($this->renderFunctionAndParameter($reflection, $pattern));
19 19
     }
Please login to merge, or discard this patch.
src/Core/src/Exception/Scope/FinalizersException.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
     public function __construct(
13 13
         ?string $scope,
14 14
         protected array $exceptions,
15
-    ) {
15
+    ){
16 16
         $count = \count($exceptions);
17 17
         parent::__construct(
18 18
             $scope,
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
                 $count === 1 ? 'An exception has been' : "$count exceptions have been",
22 22
                 $scope === null ? 'an unnamed scope' : "the scope `$scope`",
23 23
                 \implode("\n\n", \array_map(
24
-                    static fn(\Exception $e): string => \sprintf(
24
+                    static fn(\Exception $e) : string => \sprintf(
25 25
                         "# %s\n%s",
26 26
                         $e::class,
27 27
                         $e->getMessage(),
Please login to merge, or discard this patch.
src/Core/src/Exception/Traits/ClosureRendererTrait.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
         $line = $reflection->getStartLine();
28 28
 
29 29
         $fileAndLine = '';
30
-        if (!empty($fileName)) {
30
+        if (!empty($fileName)){
31 31
             $fileAndLine = "in \"$fileName\" at line $line";
32 32
         }
33 33
 
@@ -38,23 +38,23 @@  discard block
 block discarded – undo
38 38
     {
39 39
         $closureParameters = [];
40 40
 
41
-        foreach ($reflection->getParameters() as $parameter) {
41
+        foreach ($reflection->getParameters() as $parameter){
42 42
             /** @var \ReflectionNamedType|\ReflectionUnionType|null $type */
43 43
             $type = $parameter->getType();
44 44
             $parameterString = \sprintf(
45 45
                 '%s %s%s$%s',
46 46
                 // type
47
-                (string) $type,
47
+                (string)$type,
48 48
                 // reference
49 49
                 $parameter->isPassedByReference() ? '&' : '',
50 50
                 // variadic
51 51
                 $parameter->isVariadic() ? '...' : '',
52 52
                 $parameter->getName(),
53 53
             );
54
-            if ($parameter->isDefaultValueAvailable()) {
54
+            if ($parameter->isDefaultValueAvailable()){
55 55
                 $default = $parameter->getDefaultValue();
56
-                $parameterString .= ' = ' . match (true) {
57
-                    \is_object($default) => 'new ' . $default::class . '(...)',
56
+                $parameterString .= ' = '.match (true) {
57
+                    \is_object($default) => 'new '.$default::class.'(...)',
58 58
                     $parameter->isDefaultValueConstant() => $parameter->getDefaultValueConstantName(),
59 59
                     default => \var_export($default, true),
60 60
                 };
@@ -62,6 +62,6 @@  discard block
 block discarded – undo
62 62
             $closureParameters[] = \ltrim($parameterString);
63 63
         }
64 64
         $static = $reflection->isStatic() ? 'static ' : '';
65
-        return "{$static}function (" . \implode(', ', $closureParameters) . ')';
65
+        return "{$static}function (".\implode(', ', $closureParameters).')';
66 66
     }
67 67
 }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,8 @@  discard block
 block discarded – undo
27 27
         $line = $reflection->getStartLine();
28 28
 
29 29
         $fileAndLine = '';
30
-        if (!empty($fileName)) {
30
+        if (!empty($fileName))
31
+        {
31 32
             $fileAndLine = "in \"$fileName\" at line $line";
32 33
         }
33 34
 
@@ -38,7 +39,8 @@  discard block
 block discarded – undo
38 39
     {
39 40
         $closureParameters = [];
40 41
 
41
-        foreach ($reflection->getParameters() as $parameter) {
42
+        foreach ($reflection->getParameters() as $parameter)
43
+        {
42 44
             /** @var \ReflectionNamedType|\ReflectionUnionType|null $type */
43 45
             $type = $parameter->getType();
44 46
             $parameterString = \sprintf(
@@ -51,7 +53,8 @@  discard block
 block discarded – undo
51 53
                 $parameter->isVariadic() ? '...' : '',
52 54
                 $parameter->getName(),
53 55
             );
54
-            if ($parameter->isDefaultValueAvailable()) {
56
+            if ($parameter->isDefaultValueAvailable())
57
+            {
55 58
                 $default = $parameter->getDefaultValue();
56 59
                 $parameterString .= ' = ' . match (true) {
57 60
                     \is_object($default) => 'new ' . $default::class . '(...)',
Please login to merge, or discard this patch.