Passed
Pull Request — master (#1207)
by Aleksei
10:55
created
src/Bridge/Stempler/src/Visitor/FormatHTML.php 2 patches
Braces   +41 added lines, -20 removed lines patch added patch discarded remove patch
@@ -30,30 +30,38 @@  discard block
 block discarded – undo
30 30
 
31 31
     public function enterNode(mixed $node, VisitorContext $ctx): mixed
32 32
     {
33
-        if (!$node instanceof Template && !$node instanceof Block && !$node instanceof Tag) {
33
+        if (!$node instanceof Template && !$node instanceof Block && !$node instanceof Tag)
34
+        {
34 35
             return null;
35 36
         }
36 37
 
37
-        if ($node instanceof Tag && \in_array($node->name, self::EXCLUDE)) {
38
+        if ($node instanceof Tag && \in_array($node->name, self::EXCLUDE))
39
+        {
38 40
             // raw nodes
39 41
             return null;
40 42
         }
41 43
 
42 44
         $level = $this->getLevel($ctx);
43
-        if ($level === null) {
45
+        if ($level === null)
46
+        {
44 47
             // not available in some contexts
45 48
             return null;
46 49
         }
47 50
 
48
-        foreach ($node->nodes as $i => $child) {
49
-            if (!$child instanceof Raw) {
51
+        foreach ($node->nodes as $i => $child)
52
+        {
53
+            if (!$child instanceof Raw)
54
+            {
50 55
                 continue;
51 56
             }
52 57
 
53 58
             $position = self::BETWEEN_TAGS;
54
-            if (!isset($node->nodes[$i + 1])) {
59
+            if (!isset($node->nodes[$i + 1]))
60
+            {
55 61
                 $position = self::BEFORE_CLOSE;
56
-            } elseif ($node->nodes[$i + 1] instanceof PHP) {
62
+            }
63
+            elseif ($node->nodes[$i + 1] instanceof PHP)
64
+            {
57 65
                 $position = self::BEFORE_PHP;
58 66
             }
59 67
 
@@ -74,7 +82,8 @@  discard block
 block discarded – undo
74 82
 
75 83
     private function indentContent(string $content, int $level, int $position = self::BETWEEN_TAGS): string
76 84
     {
77
-        if (!\str_contains($content, "\n")) {
85
+        if (!\str_contains($content, "\n"))
86
+        {
78 87
             // no need to do anything
79 88
             return $content;
80 89
         }
@@ -82,35 +91,43 @@  discard block
 block discarded – undo
82 91
         // we have to apply special rules to the first and the last lines
83 92
         $lines = \explode("\n", $content);
84 93
 
85
-        foreach ($lines as $i => $line) {
86
-            if (\trim($line) === '' && $i !== 0) {
94
+        foreach ($lines as $i => $line)
95
+        {
96
+            if (\trim($line) === '' && $i !== 0)
97
+            {
87 98
                 unset($lines[$i]);
88 99
             }
89 100
         }
90 101
 
91 102
         $lines = \array_values($lines);
92
-        if ($lines === []) {
103
+        if ($lines === [])
104
+        {
93 105
             $lines[] = '';
94 106
         }
95 107
 
96 108
         $result = '';
97
-        foreach ($lines as $i => $line) {
98
-            if (\trim($line) !== '') {
109
+        foreach ($lines as $i => $line)
110
+        {
111
+            if (\trim($line) !== '')
112
+            {
99 113
                 $line = $i === 0 ? \rtrim($line) : \trim($line);
100 114
             }
101 115
 
102
-            if ($i !== (\count($lines) - 1)) {
116
+            if ($i !== (\count($lines) - 1))
117
+            {
103 118
                 $result .= $line . "\n" . \str_repeat(self::INDENT, $level);
104 119
                 continue;
105 120
             }
106 121
 
107 122
             // working with last line
108
-            if ($position === self::BEFORE_PHP) {
123
+            if ($position === self::BEFORE_PHP)
124
+            {
109 125
                 $result .= $line . "\n";
110 126
                 break;
111 127
             }
112 128
 
113
-            if ($position === self::BEFORE_CLOSE) {
129
+            if ($position === self::BEFORE_CLOSE)
130
+            {
114 131
                 $result .= $line . "\n" . \str_repeat(self::INDENT, max($level - 1, 0));
115 132
                 break;
116 133
             }
@@ -124,12 +141,15 @@  discard block
 block discarded – undo
124 141
     private function getLevel(VisitorContext $ctx): ?int
125 142
     {
126 143
         $level = 0;
127
-        foreach ($ctx->getScope() as $node) {
128
-            if ($node instanceof Attr) {
144
+        foreach ($ctx->getScope() as $node)
145
+        {
146
+            if ($node instanceof Attr)
147
+            {
129 148
                 return null;
130 149
             }
131 150
 
132
-            if ($node instanceof Block || $node instanceof Template) {
151
+            if ($node instanceof Block || $node instanceof Template)
152
+            {
133 153
                 continue;
134 154
             }
135 155
 
@@ -148,7 +168,8 @@  discard block
 block discarded – undo
148 168
      */
149 169
     private function normalizeEndings(string $string, bool $joinMultiple = true): string
150 170
     {
151
-        if (!$joinMultiple) {
171
+        if (!$joinMultiple)
172
+        {
152 173
             return \str_replace("\r\n", "\n", $string);
153 174
         }
154 175
 
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -29,35 +29,35 @@  discard block
 block discarded – undo
29 29
 
30 30
     public function enterNode(mixed $node, VisitorContext $ctx): mixed
31 31
     {
32
-        if (!$node instanceof Template && !$node instanceof Block && !$node instanceof Tag) {
32
+        if (!$node instanceof Template && !$node instanceof Block && !$node instanceof Tag){
33 33
             return null;
34 34
         }
35 35
 
36
-        if ($node instanceof Tag && \in_array($node->name, self::EXCLUDE)) {
36
+        if ($node instanceof Tag && \in_array($node->name, self::EXCLUDE)){
37 37
             // raw nodes
38 38
             return null;
39 39
         }
40 40
 
41 41
         $level = $this->getLevel($ctx);
42
-        if ($level === null) {
42
+        if ($level === null){
43 43
             // not available in some contexts
44 44
             return null;
45 45
         }
46 46
 
47
-        foreach ($node->nodes as $i => $child) {
48
-            if (!$child instanceof Raw) {
47
+        foreach ($node->nodes as $i => $child){
48
+            if (!$child instanceof Raw){
49 49
                 continue;
50 50
             }
51 51
 
52 52
             $position = self::BETWEEN_TAGS;
53
-            if (!isset($node->nodes[$i + 1])) {
53
+            if (!isset($node->nodes[$i + 1])){
54 54
                 $position = self::BEFORE_CLOSE;
55
-            } elseif ($node->nodes[$i + 1] instanceof PHP) {
55
+            } elseif ($node->nodes[$i + 1] instanceof PHP){
56 56
                 $position = self::BEFORE_PHP;
57 57
             }
58 58
 
59 59
             $child->content = $this->indentContent(
60
-                $this->normalizeEndings((string) $child->content, false),
60
+                $this->normalizeEndings((string)$child->content, false),
61 61
                 $level,
62 62
                 $position,
63 63
             );
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
     private function indentContent(string $content, int $level, int $position = self::BETWEEN_TAGS): string
75 75
     {
76
-        if (!\str_contains($content, "\n")) {
76
+        if (!\str_contains($content, "\n")){
77 77
             // no need to do anything
78 78
             return $content;
79 79
         }
@@ -81,40 +81,40 @@  discard block
 block discarded – undo
81 81
         // we have to apply special rules to the first and the last lines
82 82
         $lines = \explode("\n", $content);
83 83
 
84
-        foreach ($lines as $i => $line) {
85
-            if (\trim($line) === '' && $i !== 0) {
84
+        foreach ($lines as $i => $line){
85
+            if (\trim($line) === '' && $i !== 0){
86 86
                 unset($lines[$i]);
87 87
             }
88 88
         }
89 89
 
90 90
         $lines = \array_values($lines);
91
-        if ($lines === []) {
91
+        if ($lines === []){
92 92
             $lines[] = '';
93 93
         }
94 94
 
95 95
         $result = '';
96
-        foreach ($lines as $i => $line) {
97
-            if (\trim($line) !== '') {
96
+        foreach ($lines as $i => $line){
97
+            if (\trim($line) !== ''){
98 98
                 $line = $i === 0 ? \rtrim($line) : \trim($line);
99 99
             }
100 100
 
101
-            if ($i !== (\count($lines) - 1)) {
102
-                $result .= $line . "\n" . \str_repeat(self::INDENT, $level);
101
+            if ($i !== (\count($lines) - 1)){
102
+                $result .= $line."\n".\str_repeat(self::INDENT, $level);
103 103
                 continue;
104 104
             }
105 105
 
106 106
             // working with last line
107
-            if ($position === self::BEFORE_PHP) {
108
-                $result .= $line . "\n";
107
+            if ($position === self::BEFORE_PHP){
108
+                $result .= $line."\n";
109 109
                 break;
110 110
             }
111 111
 
112
-            if ($position === self::BEFORE_CLOSE) {
113
-                $result .= $line . "\n" . \str_repeat(self::INDENT, max($level - 1, 0));
112
+            if ($position === self::BEFORE_CLOSE){
113
+                $result .= $line."\n".\str_repeat(self::INDENT, max($level - 1, 0));
114 114
                 break;
115 115
             }
116 116
 
117
-            $result .= $line . "\n" . \str_repeat(self::INDENT, $level);
117
+            $result .= $line."\n".\str_repeat(self::INDENT, $level);
118 118
         }
119 119
 
120 120
         return $result;
@@ -123,12 +123,12 @@  discard block
 block discarded – undo
123 123
     private function getLevel(VisitorContext $ctx): ?int
124 124
     {
125 125
         $level = 0;
126
-        foreach ($ctx->getScope() as $node) {
127
-            if ($node instanceof Attr) {
126
+        foreach ($ctx->getScope() as $node){
127
+            if ($node instanceof Attr){
128 128
                 return null;
129 129
             }
130 130
 
131
-            if ($node instanceof Block || $node instanceof Template) {
131
+            if ($node instanceof Block || $node instanceof Template){
132 132
                 continue;
133 133
             }
134 134
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
      */
148 148
     private function normalizeEndings(string $string, bool $joinMultiple = true): string
149 149
     {
150
-        if (!$joinMultiple) {
150
+        if (!$joinMultiple){
151 151
             return \str_replace("\r\n", "\n", $string);
152 152
         }
153 153
 
Please login to merge, or discard this patch.
src/Bridge/Stempler/src/Visitor/FlattenNodes.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -22,14 +22,14 @@  discard block
 block discarded – undo
22 22
 {
23 23
     public function enterNode(mixed $node, VisitorContext $ctx): mixed
24 24
     {
25
-        if (!$node instanceof Tag) {
25
+        if (!$node instanceof Tag){
26 26
             return null;
27 27
         }
28 28
 
29 29
         $flatten = [];
30
-        foreach ($node->nodes as $child) {
31
-            if ($child instanceof Block || $child instanceof Template || $child instanceof Aggregate) {
32
-                foreach ($child->nodes as $childNode) {
30
+        foreach ($node->nodes as $child){
31
+            if ($child instanceof Block || $child instanceof Template || $child instanceof Aggregate){
32
+                foreach ($child->nodes as $childNode){
33 33
                     $flatten[] = $childNode;
34 34
                 }
35 35
                 continue;
@@ -51,12 +51,12 @@  discard block
 block discarded – undo
51 51
     private function mergeRaw(array $nodes): array
52 52
     {
53 53
         $result = [];
54
-        foreach ($nodes as $node) {
54
+        foreach ($nodes as $node){
55 55
             if (
56 56
                 $node instanceof Raw
57 57
                 && isset($result[\count($result) - 1])
58 58
                 && $result[\count($result) - 1] instanceof Raw
59
-            ) {
59
+            ){
60 60
                 $result[\count($result) - 1]->content .= $node->content;
61 61
                 continue;
62 62
             }
Please login to merge, or discard this patch.
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,14 +22,18 @@  discard block
 block discarded – undo
22 22
 {
23 23
     public function enterNode(mixed $node, VisitorContext $ctx): mixed
24 24
     {
25
-        if (!$node instanceof Tag) {
25
+        if (!$node instanceof Tag)
26
+        {
26 27
             return null;
27 28
         }
28 29
 
29 30
         $flatten = [];
30
-        foreach ($node->nodes as $child) {
31
-            if ($child instanceof Block || $child instanceof Template || $child instanceof Aggregate) {
32
-                foreach ($child->nodes as $childNode) {
31
+        foreach ($node->nodes as $child)
32
+        {
33
+            if ($child instanceof Block || $child instanceof Template || $child instanceof Aggregate)
34
+            {
35
+                foreach ($child->nodes as $childNode)
36
+                {
33 37
                     $flatten[] = $childNode;
34 38
                 }
35 39
                 continue;
@@ -51,7 +55,8 @@  discard block
 block discarded – undo
51 55
     private function mergeRaw(array $nodes): array
52 56
     {
53 57
         $result = [];
54
-        foreach ($nodes as $node) {
58
+        foreach ($nodes as $node)
59
+        {
55 60
             if (
56 61
                 $node instanceof Raw
57 62
                 && isset($result[\count($result) - 1])
Please login to merge, or discard this patch.
src/Bridge/Monolog/src/Config/MonologConfig.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -35,18 +35,18 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public function getHandlers(string $channel): \Generator
37 37
     {
38
-        if (empty($this->config['handlers'][$channel])) {
38
+        if (empty($this->config['handlers'][$channel])){
39 39
             return;
40 40
         }
41 41
 
42
-        foreach ($this->config['handlers'][$channel] as $handler) {
43
-            if (\is_object($handler) && !$handler instanceof Autowire) {
42
+        foreach ($this->config['handlers'][$channel] as $handler){
43
+            if (\is_object($handler) && !$handler instanceof Autowire){
44 44
                 yield $handler;
45 45
                 continue;
46 46
             }
47 47
 
48 48
             $wire = $this->wire($handler);
49
-            if (\is_null($wire)) {
49
+            if (\is_null($wire)){
50 50
                 throw new ConfigException(\sprintf('Invalid handler definition for channel `%s`.', $channel));
51 51
             }
52 52
 
@@ -56,18 +56,18 @@  discard block
 block discarded – undo
56 56
 
57 57
     public function getProcessors(string $channel): \Generator
58 58
     {
59
-        if (empty($this->config['processors'][$channel])) {
59
+        if (empty($this->config['processors'][$channel])){
60 60
             return;
61 61
         }
62 62
 
63
-        foreach ($this->config['processors'][$channel] as $processor) {
64
-            if (\is_object($processor) && !$processor instanceof Autowire) {
63
+        foreach ($this->config['processors'][$channel] as $processor){
64
+            if (\is_object($processor) && !$processor instanceof Autowire){
65 65
                 yield $processor;
66 66
                 continue;
67 67
             }
68 68
 
69 69
             $wire = $this->wire($processor);
70
-            if (\is_null($wire)) {
70
+            if (\is_null($wire)){
71 71
                 throw new ConfigException(\sprintf('Invalid processor definition for channel `%s`.', $channel));
72 72
             }
73 73
 
@@ -75,17 +75,17 @@  discard block
 block discarded – undo
75 75
         }
76 76
     }
77 77
 
78
-    private function wire(Autowire|string|array $definition): ?Autowire
78
+    private function wire(Autowire | string | array $definition): ?Autowire
79 79
     {
80
-        if ($definition instanceof Autowire) {
80
+        if ($definition instanceof Autowire){
81 81
             return $definition;
82 82
         }
83 83
 
84
-        if (\is_string($definition)) {
84
+        if (\is_string($definition)){
85 85
             return new Autowire($definition);
86 86
         }
87 87
 
88
-        if (isset($definition['class'])) {
88
+        if (isset($definition['class'])){
89 89
             return new Autowire($definition['class'], $definition['options'] ?? []);
90 90
         }
91 91
 
Please login to merge, or discard this patch.
Braces   +22 added lines, -11 removed lines patch added patch discarded remove patch
@@ -35,18 +35,22 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public function getHandlers(string $channel): \Generator
37 37
     {
38
-        if (empty($this->config['handlers'][$channel])) {
38
+        if (empty($this->config['handlers'][$channel]))
39
+        {
39 40
             return;
40 41
         }
41 42
 
42
-        foreach ($this->config['handlers'][$channel] as $handler) {
43
-            if (\is_object($handler) && !$handler instanceof Autowire) {
43
+        foreach ($this->config['handlers'][$channel] as $handler)
44
+        {
45
+            if (\is_object($handler) && !$handler instanceof Autowire)
46
+            {
44 47
                 yield $handler;
45 48
                 continue;
46 49
             }
47 50
 
48 51
             $wire = $this->wire($handler);
49
-            if (\is_null($wire)) {
52
+            if (\is_null($wire))
53
+            {
50 54
                 throw new ConfigException(\sprintf('Invalid handler definition for channel `%s`.', $channel));
51 55
             }
52 56
 
@@ -56,18 +60,22 @@  discard block
 block discarded – undo
56 60
 
57 61
     public function getProcessors(string $channel): \Generator
58 62
     {
59
-        if (empty($this->config['processors'][$channel])) {
63
+        if (empty($this->config['processors'][$channel]))
64
+        {
60 65
             return;
61 66
         }
62 67
 
63
-        foreach ($this->config['processors'][$channel] as $processor) {
64
-            if (\is_object($processor) && !$processor instanceof Autowire) {
68
+        foreach ($this->config['processors'][$channel] as $processor)
69
+        {
70
+            if (\is_object($processor) && !$processor instanceof Autowire)
71
+            {
65 72
                 yield $processor;
66 73
                 continue;
67 74
             }
68 75
 
69 76
             $wire = $this->wire($processor);
70
-            if (\is_null($wire)) {
77
+            if (\is_null($wire))
78
+            {
71 79
                 throw new ConfigException(\sprintf('Invalid processor definition for channel `%s`.', $channel));
72 80
             }
73 81
 
@@ -77,15 +85,18 @@  discard block
 block discarded – undo
77 85
 
78 86
     private function wire(Autowire|string|array $definition): ?Autowire
79 87
     {
80
-        if ($definition instanceof Autowire) {
88
+        if ($definition instanceof Autowire)
89
+        {
81 90
             return $definition;
82 91
         }
83 92
 
84
-        if (\is_string($definition)) {
93
+        if (\is_string($definition))
94
+        {
85 95
             return new Autowire($definition);
86 96
         }
87 97
 
88
-        if (isset($definition['class'])) {
98
+        if (isset($definition['class']))
99
+        {
89 100
             return new Autowire($definition['class'], $definition['options'] ?? []);
90 101
         }
91 102
 
Please login to merge, or discard this patch.
src/Bridge/Monolog/src/LogFactory.php 2 patches
Braces   +26 added lines, -12 removed lines patch added patch discarded remove patch
@@ -35,8 +35,10 @@  discard block
 block discarded – undo
35 35
     {
36 36
         $default = $this->config->getDefault();
37 37
 
38
-        if ($channel === null || $channel === $default) {
39
-            if ($this->default !== null) {
38
+        if ($channel === null || $channel === $default)
39
+        {
40
+            if ($this->default !== null)
41
+            {
40 42
                 // we should use only one default logger per system
41 43
                 return $this->default;
42 44
             }
@@ -63,7 +65,8 @@  discard block
 block discarded – undo
63 65
 
64 66
     public function reset(): void
65 67
     {
66
-        if ($this->default instanceof ResettableInterface) {
68
+        if ($this->default instanceof ResettableInterface)
69
+        {
67 70
             $this->default->reset();
68 71
         }
69 72
     }
@@ -79,15 +82,20 @@  discard block
 block discarded – undo
79 82
         // always include default handler
80 83
         $handlers = [];
81 84
 
82
-        foreach ($this->config->getHandlers($channel) as $handler) {
83
-            if (!$handler instanceof Autowire) {
85
+        foreach ($this->config->getHandlers($channel) as $handler)
86
+        {
87
+            if (!$handler instanceof Autowire)
88
+            {
84 89
                 $handlers[] = $handler;
85 90
                 continue;
86 91
             }
87 92
 
88
-            try {
93
+            try
94
+            {
89 95
                 $handlers[] = $handler->resolve($this->factory);
90
-            } catch (ContainerExceptionInterface $e) {
96
+            }
97
+            catch (ContainerExceptionInterface $e)
98
+            {
91 99
                 throw new ConfigException($e->getMessage(), $e->getCode(), $e);
92 100
             }
93 101
         }
@@ -105,20 +113,26 @@  discard block
 block discarded – undo
105 113
     protected function getProcessors(string $channel): array
106 114
     {
107 115
         $processors = [];
108
-        foreach ($this->config->getProcessors($channel) as $processor) {
109
-            if (!$processor instanceof Autowire) {
116
+        foreach ($this->config->getProcessors($channel) as $processor)
117
+        {
118
+            if (!$processor instanceof Autowire)
119
+            {
110 120
                 $processors[] = $processor;
111 121
                 continue;
112 122
             }
113 123
 
114
-            try {
124
+            try
125
+            {
115 126
                 $processors[] = $processor->resolve($this->factory);
116
-            } catch (ContainerExceptionInterface $e) {
127
+            }
128
+            catch (ContainerExceptionInterface $e)
129
+            {
117 130
                 throw new ConfigException($e->getMessage(), $e->getCode(), $e);
118 131
             }
119 132
         }
120 133
 
121
-        if ($processors === []) {
134
+        if ($processors === [])
135
+        {
122 136
             $processors[] = new PsrLogMessageProcessor();
123 137
         }
124 138
 
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         private readonly MonologConfig $config,
32 32
         ListenerRegistryInterface $listenerRegistry,
33 33
         private readonly FactoryInterface $factory,
34
-    ) {
34
+    ){
35 35
         $this->eventHandler = new EventHandler($listenerRegistry, $config->getEventLevel());
36 36
     }
37 37
 
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
     {
40 40
         $default = $this->config->getDefault();
41 41
 
42
-        if ($channel === null || $channel === $default) {
43
-            if ($this->default !== null) {
42
+        if ($channel === null || $channel === $default){
43
+            if ($this->default !== null){
44 44
                 // we should use only one default logger per system
45 45
                 return $this->default;
46 46
             }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
     public function reset(): void
71 71
     {
72
-        if ($this->default instanceof ResettableInterface) {
72
+        if ($this->default instanceof ResettableInterface){
73 73
             $this->default->reset();
74 74
         }
75 75
     }
@@ -84,15 +84,15 @@  discard block
 block discarded – undo
84 84
         // always include default handler
85 85
         $handlers = [];
86 86
 
87
-        foreach ($this->config->getHandlers($channel) as $handler) {
88
-            if (!$handler instanceof Autowire) {
87
+        foreach ($this->config->getHandlers($channel) as $handler){
88
+            if (!$handler instanceof Autowire){
89 89
                 $handlers[] = $handler;
90 90
                 continue;
91 91
             }
92 92
 
93
-            try {
93
+            try{
94 94
                 $handlers[] = $handler->resolve($this->factory);
95
-            } catch (ContainerExceptionInterface $e) {
95
+            }catch (ContainerExceptionInterface $e){
96 96
                 throw new ConfigException($e->getMessage(), $e->getCode(), $e);
97 97
             }
98 98
         }
@@ -110,20 +110,20 @@  discard block
 block discarded – undo
110 110
     protected function getProcessors(string $channel): array
111 111
     {
112 112
         $processors = [];
113
-        foreach ($this->config->getProcessors($channel) as $processor) {
114
-            if (!$processor instanceof Autowire) {
113
+        foreach ($this->config->getProcessors($channel) as $processor){
114
+            if (!$processor instanceof Autowire){
115 115
                 $processors[] = $processor;
116 116
                 continue;
117 117
             }
118 118
 
119
-            try {
119
+            try{
120 120
                 $processors[] = $processor->resolve($this->factory);
121
-            } catch (ContainerExceptionInterface $e) {
121
+            }catch (ContainerExceptionInterface $e){
122 122
                 throw new ConfigException($e->getMessage(), $e->getCode(), $e);
123 123
             }
124 124
         }
125 125
 
126
-        if ($processors === []) {
126
+        if ($processors === []){
127 127
             $processors[] = new PsrLogMessageProcessor();
128 128
         }
129 129
 
Please login to merge, or discard this patch.
src/Views/src/Config/ViewsConfig.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,8 @@
 block discarded – undo
79 79
      */
80 80
     private function wire(Autowire|string $item): Autowire
81 81
     {
82
-        if ($item instanceof Autowire) {
82
+        if ($item instanceof Autowire)
83
+        {
83 84
             return $item;
84 85
         }
85 86
 
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
     public function getGlobalVariables(): array
29 29
     {
30
-        return (array) ($this->config['globalVariables'] ?? []);
30
+        return (array)($this->config['globalVariables'] ?? []);
31 31
     }
32 32
 
33 33
     public function isCacheEnabled(): bool
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
     public function getCacheDirectory(): string
39 39
     {
40
-        return \rtrim($this->config['cache']['directory'] ?? '', '/') . '/';
40
+        return \rtrim($this->config['cache']['directory'] ?? '', '/').'/';
41 41
     }
42 42
 
43 43
     /**
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      */
46 46
     public function getNamespaces(): array
47 47
     {
48
-        return (array) ($this->config['namespaces'] ?? []);
48
+        return (array)($this->config['namespaces'] ?? []);
49 49
     }
50 50
 
51 51
     /**
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     {
58 58
         return \array_map(
59 59
             fn(mixed $dependency): Autowire =>  $this->wire($dependency),
60
-            (array) ($this->config['dependencies'] ?? []),
60
+            (array)($this->config['dependencies'] ?? []),
61 61
         );
62 62
     }
63 63
 
@@ -70,16 +70,16 @@  discard block
 block discarded – undo
70 70
     {
71 71
         return \array_map(
72 72
             fn(mixed $engine): Autowire =>  $this->wire($engine),
73
-            (array) ($this->config['engines'] ?? []),
73
+            (array)($this->config['engines'] ?? []),
74 74
         );
75 75
     }
76 76
 
77 77
     /**
78 78
      * @param Autowire|class-string $item
79 79
      */
80
-    private function wire(Autowire|string $item): Autowire
80
+    private function wire(Autowire | string $item): Autowire
81 81
     {
82
-        if ($item instanceof Autowire) {
82
+        if ($item instanceof Autowire){
83 83
             return $item;
84 84
         }
85 85
 
Please login to merge, or discard this patch.
src/Views/src/ViewContext.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     public function getID(): string
21 21
     {
22 22
         $calculated = '';
23
-        foreach ($this->dependencies as $dependency) {
23
+        foreach ($this->dependencies as $dependency){
24 24
             $calculated .= \sprintf('[%s=%s]', $dependency->getName(), $dependency->getValue());
25 25
         }
26 26
 
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 
48 48
     public function resolveValue(string $dependency): mixed
49 49
     {
50
-        if (!isset($this->dependencies[$dependency])) {
50
+        if (!isset($this->dependencies[$dependency])){
51 51
             throw new ContextException(\sprintf('Undefined context dependency \'%s\'.', $dependency));
52 52
         }
53 53
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,8 @@  discard block
 block discarded – undo
20 20
     public function getID(): string
21 21
     {
22 22
         $calculated = '';
23
-        foreach ($this->dependencies as $dependency) {
23
+        foreach ($this->dependencies as $dependency)
24
+        {
24 25
             $calculated .= \sprintf('[%s=%s]', $dependency->getName(), $dependency->getValue());
25 26
         }
26 27
 
@@ -47,7 +48,8 @@  discard block
 block discarded – undo
47 48
 
48 49
     public function resolveValue(string $dependency): mixed
49 50
     {
50
-        if (!isset($this->dependencies[$dependency])) {
51
+        if (!isset($this->dependencies[$dependency]))
52
+        {
51 53
             throw new ContextException(\sprintf('Undefined context dependency \'%s\'.', $dependency));
52 54
         }
53 55
 
Please login to merge, or discard this patch.
src/Views/src/Engine/AbstractEngine.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 
29 29
     public function getLoader(): LoaderInterface
30 30
     {
31
-        if (empty($this->loader)) {
31
+        if (empty($this->loader)){
32 32
             throw new EngineException('No associated loader found');
33 33
         }
34 34
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,8 @@
 block discarded – undo
28 28
 
29 29
     public function getLoader(): LoaderInterface
30 30
     {
31
-        if (empty($this->loader)) {
31
+        if (empty($this->loader))
32
+        {
32 33
             throw new EngineException('No associated loader found');
33 34
         }
34 35
 
Please login to merge, or discard this patch.
src/Hmvc/tests/DemoInterceptor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,6 +11,6 @@
 block discarded – undo
11 11
 {
12 12
     public function process(string $controller, string $action, array $parameters, CoreInterface $core): string
13 13
     {
14
-        return '?' . $core->callAction($controller, $action, $parameters) . '!';
14
+        return '?'.$core->callAction($controller, $action, $parameters).'!';
15 15
     }
16 16
 }
Please login to merge, or discard this patch.
src/Hmvc/tests/InterceptorPipelineTest.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 {
16 16
     public function testInterceptorCallingEventShouldBeDispatched(): void
17 17
     {
18
-        $interceptor = new class implements CoreInterceptorInterface {
18
+        $interceptor = new class implements CoreInterceptorInterface{
19 19
             public function process(string $controller, string $action, array $parameters, CoreInterface $core): mixed
20 20
             {
21 21
                 return null;
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         $pipeline = new InterceptorPipeline($dispatcher);
32 32
         $pipeline->addInterceptor($interceptor);
33 33
 
34
-        $pipeline->withCore(new class implements CoreInterface {
34
+        $pipeline->withCore(new class implements CoreInterface{
35 35
             public function callAction(string $controller, string $action, array $parameters = []): mixed
36 36
             {
37 37
                 return null;
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,8 @@  discard block
 block discarded – undo
15 15
 {
16 16
     public function testInterceptorCallingEventShouldBeDispatched(): void
17 17
     {
18
-        $interceptor = new class implements CoreInterceptorInterface {
18
+        $interceptor = new class implements CoreInterceptorInterface
19
+        {
19 20
             public function process(string $controller, string $action, array $parameters, CoreInterface $core): mixed
20 21
             {
21 22
                 return null;
@@ -31,7 +32,8 @@  discard block
 block discarded – undo
31 32
         $pipeline = new InterceptorPipeline($dispatcher);
32 33
         $pipeline->addInterceptor($interceptor);
33 34
 
34
-        $pipeline->withCore(new class implements CoreInterface {
35
+        $pipeline->withCore(new class implements CoreInterface
36
+        {
35 37
             public function callAction(string $controller, string $action, array $parameters = []): mixed
36 38
             {
37 39
                 return null;
Please login to merge, or discard this patch.