Test Failed
Pull Request — master (#1003)
by Maxim
20:36 queued 08:54
created
src/Console/src/Sequence/CommandSequence.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
         private readonly array $options = [],
19 19
         string $header = '',
20 20
         string $footer = ''
21
-    ) {
21
+    ){
22 22
         parent::__construct($header, $footer);
23 23
     }
24 24
 
Please login to merge, or discard this patch.
src/Console/src/Sequence/CallableSequence.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -20,10 +20,10 @@  discard block
 block discarded – undo
20 20
      * @param string|callable|array<class-string, string> $function
21 21
      */
22 22
     public function __construct(
23
-        string|array|callable $function,
23
+        string | array | callable $function,
24 24
         string $header = '',
25 25
         string $footer = ''
26
-    ) {
26
+    ){
27 27
         $this->function = $function;
28 28
         parent::__construct($header, $footer);
29 29
     }
@@ -31,18 +31,18 @@  discard block
 block discarded – undo
31 31
     public function execute(ContainerInterface $container, OutputInterface $output): void
32 32
     {
33 33
         $function = $this->function;
34
-        if (\is_string($function) && \str_contains($function, ':')) {
34
+        if (\is_string($function) && \str_contains($function, ':')){
35 35
             $function = \explode(':', \str_replace('::', ':', $function));
36 36
         }
37 37
 
38
-        if (\is_array($function) && isset($function[0]) && !\is_object($function[0])) {
38
+        if (\is_array($function) && isset($function[0]) && !\is_object($function[0])){
39 39
             $function[0] = $container->get($function[0]);
40 40
         }
41 41
 
42 42
         /** @var ResolverInterface $resolver */
43 43
         $resolver = $container->get(ResolverInterface::class);
44 44
 
45
-        if (\is_array($function)) {
45
+        if (\is_array($function)){
46 46
             $reflection = new \ReflectionMethod($function[0], $function[1]);
47 47
             $reflection->invokeArgs($function[0], $resolver->resolveArguments($reflection, [
48 48
                 'output' => $output,
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,18 +31,21 @@
 block discarded – undo
31 31
     public function execute(ContainerInterface $container, OutputInterface $output): void
32 32
     {
33 33
         $function = $this->function;
34
-        if (\is_string($function) && \str_contains($function, ':')) {
34
+        if (\is_string($function) && \str_contains($function, ':'))
35
+        {
35 36
             $function = \explode(':', \str_replace('::', ':', $function));
36 37
         }
37 38
 
38
-        if (\is_array($function) && isset($function[0]) && !\is_object($function[0])) {
39
+        if (\is_array($function) && isset($function[0]) && !\is_object($function[0]))
40
+        {
39 41
             $function[0] = $container->get($function[0]);
40 42
         }
41 43
 
42 44
         /** @var ResolverInterface $resolver */
43 45
         $resolver = $container->get(ResolverInterface::class);
44 46
 
45
-        if (\is_array($function)) {
47
+        if (\is_array($function))
48
+        {
46 49
             $reflection = new \ReflectionMethod($function[0], $function[1]);
47 50
             $reflection->invokeArgs($function[0], $resolver->resolveArguments($reflection, [
48 51
                 'output' => $output,
Please login to merge, or discard this patch.
src/Console/src/Command/SequenceCommand.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,17 +23,17 @@
 block discarded – undo
23 23
     protected function runSequence(iterable $commands, ContainerInterface $container): int
24 24
     {
25 25
         $errors = 0;
26
-        foreach ($commands as $sequence) {
26
+        foreach ($commands as $sequence){
27 27
             $sequence->writeHeader($this->output);
28 28
 
29
-            try {
29
+            try{
30 30
                 $sequence->execute($container, $this->output);
31 31
                 $sequence->writeFooter($this->output);
32
-            } catch (Throwable $e) {
32
+            }catch (Throwable $e){
33 33
                 $errors++;
34 34
                 $this->error((string)$e);
35 35
 
36
-                if (!$this->option('ignore') && $this->option('break')) {
36
+                if (!$this->option('ignore') && $this->option('break')){
37 37
                     $this->error('Aborting.');
38 38
 
39 39
                     return self::FAILURE;
Please login to merge, or discard this patch.
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,17 +23,22 @@
 block discarded – undo
23 23
     protected function runSequence(iterable $commands, ContainerInterface $container): int
24 24
     {
25 25
         $errors = 0;
26
-        foreach ($commands as $sequence) {
26
+        foreach ($commands as $sequence)
27
+        {
27 28
             $sequence->writeHeader($this->output);
28 29
 
29
-            try {
30
+            try
31
+            {
30 32
                 $sequence->execute($container, $this->output);
31 33
                 $sequence->writeFooter($this->output);
32
-            } catch (Throwable $e) {
34
+            }
35
+            catch (Throwable $e)
36
+            {
33 37
                 $errors++;
34 38
                 $this->error((string)$e);
35 39
 
36
-                if (!$this->option('ignore') && $this->option('break')) {
40
+                if (!$this->option('ignore') && $this->option('break'))
41
+                {
37 42
                     $this->error('Aborting.');
38 43
 
39 44
                     return self::FAILURE;
Please login to merge, or discard this patch.
src/Console/src/Bootloader/ConsoleBootloader.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
     public function __construct(
43 43
         private readonly ConfiguratorInterface $config
44
-    ) {
44
+    ){
45 45
     }
46 46
 
47 47
     public function init(AbstractKernel $kernel): void
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     }
96 96
 
97 97
     public function addConfigureSequence(
98
-        string|array|\Closure $sequence,
98
+        string | array | \Closure $sequence,
99 99
         string $header,
100 100
         string $footer = '',
101 101
         array $options = []
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     }
105 105
 
106 106
     public function addUpdateSequence(
107
-        string|array|\Closure $sequence,
107
+        string | array | \Closure $sequence,
108 108
         string $header,
109 109
         string $footer = '',
110 110
         array $options = []
@@ -114,12 +114,12 @@  discard block
 block discarded – undo
114 114
 
115 115
     public function addSequence(
116 116
         string $name,
117
-        string|array|\Closure $sequence,
117
+        string | array | \Closure $sequence,
118 118
         string $header,
119 119
         string $footer = '',
120 120
         array $options = []
121 121
     ): void {
122
-        if (!isset($this->config->getConfig(ConsoleConfig::CONFIG)['sequences'][$name])) {
122
+        if (!isset($this->config->getConfig(ConsoleConfig::CONFIG)['sequences'][$name])){
123 123
             $this->config->modify(
124 124
                 ConsoleConfig::CONFIG,
125 125
                 new Append('sequences', $name, [])
@@ -128,13 +128,13 @@  discard block
 block discarded – undo
128 128
 
129 129
         $this->config->modify(
130 130
             ConsoleConfig::CONFIG,
131
-            $this->sequence('sequences.' . $name, $sequence, $header, $footer, $options)
131
+            $this->sequence('sequences.'.$name, $sequence, $header, $footer, $options)
132 132
         );
133 133
     }
134 134
 
135 135
     private function sequence(
136 136
         string $target,
137
-        string|array|callable $sequence,
137
+        string | array | callable $sequence,
138 138
         string $header,
139 139
         string $footer,
140 140
         array $options
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -119,7 +119,8 @@
 block discarded – undo
119 119
         string $footer = '',
120 120
         array $options = []
121 121
     ): void {
122
-        if (!isset($this->config->getConfig(ConsoleConfig::CONFIG)['sequences'][$name])) {
122
+        if (!isset($this->config->getConfig(ConsoleConfig::CONFIG)['sequences'][$name]))
123
+        {
123 124
             $this->config->modify(
124 125
                 ConsoleConfig::CONFIG,
125 126
                 new Append('sequences', $name, [])
Please login to merge, or discard this patch.
src/Translator/src/Matcher.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
         return match (true) {
25 25
             $string === $pattern => true,
26 26
             !$this->isPattern($pattern) => false,
27
-            default => (bool) \preg_match($this->getRegex($pattern), $string)
27
+            default => (bool)\preg_match($this->getRegex($pattern), $string)
28 28
         };
29 29
     }
30 30
 
Please login to merge, or discard this patch.
src/Translator/src/Exception/LocaleException.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
         protected string $locale,
14 14
         int $code = 0,
15 15
         \Throwable $previous = null
16
-    ) {
16
+    ){
17 17
         parent::__construct(\sprintf('Undefined locale \'%s\'', $locale), $code, $previous);
18 18
     }
19 19
 
Please login to merge, or discard this patch.
src/Translator/src/Traits/TranslatorTrait.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,13 +33,13 @@  discard block
 block discarded – undo
33 33
      */
34 34
     protected function say(string $string, array $options = [], string $bundle = null): string
35 35
     {
36
-        if (Translator::isMessage($string)) {
36
+        if (Translator::isMessage($string)){
37 37
             //Cut [[ and ]]
38 38
             $string = \substr($string, 2, -2);
39 39
         }
40 40
 
41 41
         $container = ContainerScope::getContainer();
42
-        if (empty($container) || !$container->has(TranslatorInterface::class)) {
42
+        if (empty($container) || !$container->has(TranslatorInterface::class)){
43 43
             return Translator::interpolate($string, $options);
44 44
         }
45 45
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
          */
49 49
         $translator = $container->get(TranslatorInterface::class);
50 50
 
51
-        if (\is_null($bundle)) {
51
+        if (\is_null($bundle)){
52 52
             $bundle = $translator->getDomain(static::class);
53 53
         }
54 54
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,13 +33,15 @@  discard block
 block discarded – undo
33 33
      */
34 34
     protected function say(string $string, array $options = [], string $bundle = null): string
35 35
     {
36
-        if (Translator::isMessage($string)) {
36
+        if (Translator::isMessage($string))
37
+        {
37 38
             //Cut [[ and ]]
38 39
             $string = \substr($string, 2, -2);
39 40
         }
40 41
 
41 42
         $container = ContainerScope::getContainer();
42
-        if (empty($container) || !$container->has(TranslatorInterface::class)) {
43
+        if (empty($container) || !$container->has(TranslatorInterface::class))
44
+        {
43 45
             return Translator::interpolate($string, $options);
44 46
         }
45 47
 
@@ -48,7 +50,8 @@  discard block
 block discarded – undo
48 50
          */
49 51
         $translator = $container->get(TranslatorInterface::class);
50 52
 
51
-        if (\is_null($bundle)) {
53
+        if (\is_null($bundle))
54
+        {
52 55
             $bundle = $translator->getDomain(static::class);
53 56
         }
54 57
 
Please login to merge, or discard this patch.
src/Translator/src/Event/LocaleUpdated.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,6 +8,6 @@
 block discarded – undo
8 8
 {
9 9
     public function __construct(
10 10
         public readonly string $locale,
11
-    ) {
11
+    ){
12 12
     }
13 13
 }
Please login to merge, or discard this patch.
src/Translator/src/helpers.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 use Spiral\Translator\Exception\TranslatorException;
8 8
 use Spiral\Translator\TranslatorInterface;
9 9
 
10
-if (!\function_exists('l')) {
10
+if (!\function_exists('l')){
11 11
     /**
12 12
      * Translate message using default or specific bundle name.
13 13
      *
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     {
23 23
         /** @psalm-suppress InternalMethod */
24 24
         $container = ContainerScope::getContainer();
25
-        if ($container === null || !$container->has(TranslatorInterface::class)) {
25
+        if ($container === null || !$container->has(TranslatorInterface::class)){
26 26
             throw new ScopeException(
27 27
                 '`TranslatorInterface` binding is missing or container scope is not set'
28 28
             );
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     }
36 36
 }
37 37
 
38
-if (!\function_exists('p')) {
38
+if (!\function_exists('p')){
39 39
     /**
40 40
      * Pluralize string using language pluralization options and specified numeric value.
41 41
      *
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     {
52 52
         /** @psalm-suppress InternalMethod */
53 53
         $container = ContainerScope::getContainer();
54
-        if (empty($container) || !$container->has(TranslatorInterface::class)) {
54
+        if (empty($container) || !$container->has(TranslatorInterface::class)){
55 55
             throw new ScopeException(
56 56
                 '`TranslatorInterface` binding is missing or container scope is not set'
57 57
             );
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,7 +7,8 @@  discard block
 block discarded – undo
7 7
 use Spiral\Translator\Exception\TranslatorException;
8 8
 use Spiral\Translator\TranslatorInterface;
9 9
 
10
-if (!\function_exists('l')) {
10
+if (!\function_exists('l'))
11
+{
11 12
     /**
12 13
      * Translate message using default or specific bundle name.
13 14
      *
@@ -22,7 +23,8 @@  discard block
 block discarded – undo
22 23
     {
23 24
         /** @psalm-suppress InternalMethod */
24 25
         $container = ContainerScope::getContainer();
25
-        if ($container === null || !$container->has(TranslatorInterface::class)) {
26
+        if ($container === null || !$container->has(TranslatorInterface::class))
27
+        {
26 28
             throw new ScopeException(
27 29
                 '`TranslatorInterface` binding is missing or container scope is not set'
28 30
             );
@@ -35,7 +37,8 @@  discard block
 block discarded – undo
35 37
     }
36 38
 }
37 39
 
38
-if (!\function_exists('p')) {
40
+if (!\function_exists('p'))
41
+{
39 42
     /**
40 43
      * Pluralize string using language pluralization options and specified numeric value.
41 44
      *
@@ -51,7 +54,8 @@  discard block
 block discarded – undo
51 54
     {
52 55
         /** @psalm-suppress InternalMethod */
53 56
         $container = ContainerScope::getContainer();
54
-        if (empty($container) || !$container->has(TranslatorInterface::class)) {
57
+        if (empty($container) || !$container->has(TranslatorInterface::class))
58
+        {
55 59
             throw new ScopeException(
56 60
                 '`TranslatorInterface` binding is missing or container scope is not set'
57 61
             );
Please login to merge, or discard this patch.