Passed
Push — master ( ccffb6...f76682 )
by butschster
15:36 queued 17s
created
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/tests/RotateHandlerTest.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
         $finalizer->shouldReceive('addFinalizer')->once();
41 41
 
42 42
         $this->container->bind(ConfiguratorInterface::class, new ConfigManager(
43
-            new class() implements LoaderInterface {
43
+            new class() implements LoaderInterface{
44 44
                 public function has(string $section): bool
45 45
                 {
46 46
                     return false;
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,8 @@
 block discarded – undo
40 40
         $finalizer->shouldReceive('addFinalizer')->once();
41 41
 
42 42
         $this->container->bind(ConfiguratorInterface::class, new ConfigManager(
43
-            new class() implements LoaderInterface {
43
+            new class() implements LoaderInterface
44
+            {
44 45
                 public function has(string $section): bool
45 46
                 {
46 47
                     return false;
Please login to merge, or discard this patch.
src/Bridge/Monolog/tests/LoggerTest.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
     public function testLoggerShouldBeReset()
26 26
     {
27 27
         $this->container->bind(ConfiguratorInterface::class, new ConfigManager(
28
-            new class() implements LoaderInterface {
28
+            new class() implements LoaderInterface{
29 29
                 public function has(string $section): bool
30 30
                 {
31 31
                     return false;
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,8 @@
 block discarded – undo
25 25
     public function testLoggerShouldBeReset()
26 26
     {
27 27
         $this->container->bind(ConfiguratorInterface::class, new ConfigManager(
28
-            new class() implements LoaderInterface {
28
+            new class() implements LoaderInterface
29
+            {
29 30
                 public function has(string $section): bool
30 31
                 {
31 32
                     return false;
Please login to merge, or discard this patch.
src/Bridge/Monolog/tests/FactoryTest.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
     public function testDefaultLogger(): void
31 31
     {
32
-        $factory = new LogFactory(new MonologConfig([]), new ListenerRegistry(),$this->container);
32
+        $factory = new LogFactory(new MonologConfig([]), new ListenerRegistry(), $this->container);
33 33
         $logger = $factory->getLogger();
34 34
 
35 35
         $this->assertNotEmpty($logger);
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         $logger = $factory->getLogger();
55 55
 
56 56
         $this->container->bind(ConfiguratorInterface::class, new ConfigManager(
57
-            new class() implements LoaderInterface {
57
+            new class() implements LoaderInterface{
58 58
                 public function has(string $section): bool
59 59
                 {
60 60
                     return false;
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     public function testFinalizerShouldResetDefaultLogger()
81 81
     {
82 82
         $this->container->bind(ConfiguratorInterface::class, new ConfigManager(
83
-            new class() implements LoaderInterface {
83
+            new class() implements LoaderInterface{
84 84
                 public function has(string $section): bool
85 85
                 {
86 86
                     return false;
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     public function testFinalizerShouldNotResetLoggerWhenApplicationTerminating()
121 121
     {
122 122
         $this->container->bind(ConfiguratorInterface::class, new ConfigManager(
123
-            new class() implements LoaderInterface {
123
+            new class() implements LoaderInterface{
124 124
                 public function has(string $section): bool
125 125
                 {
126 126
                     return false;
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -54,7 +54,8 @@  discard block
 block discarded – undo
54 54
         $logger = $factory->getLogger();
55 55
 
56 56
         $this->container->bind(ConfiguratorInterface::class, new ConfigManager(
57
-            new class() implements LoaderInterface {
57
+            new class() implements LoaderInterface
58
+            {
58 59
                 public function has(string $section): bool
59 60
                 {
60 61
                     return false;
@@ -80,7 +81,8 @@  discard block
 block discarded – undo
80 81
     public function testFinalizerShouldResetDefaultLogger()
81 82
     {
82 83
         $this->container->bind(ConfiguratorInterface::class, new ConfigManager(
83
-            new class() implements LoaderInterface {
84
+            new class() implements LoaderInterface
85
+            {
84 86
                 public function has(string $section): bool
85 87
                 {
86 88
                     return false;
@@ -120,7 +122,8 @@  discard block
 block discarded – undo
120 122
     public function testFinalizerShouldNotResetLoggerWhenApplicationTerminating()
121 123
     {
122 124
         $this->container->bind(ConfiguratorInterface::class, new ConfigManager(
123
-            new class() implements LoaderInterface {
125
+            new class() implements LoaderInterface
126
+            {
124 127
                 public function has(string $section): bool
125 128
                 {
126 129
                     return false;
Please login to merge, or discard this patch.
src/Bridge/Monolog/tests/TraitTest.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
         $finalizer->shouldReceive('addFinalizer')->once();
41 41
 
42 42
         $this->container->bind(ConfiguratorInterface::class, new ConfigManager(
43
-            new class() implements LoaderInterface {
43
+            new class() implements LoaderInterface{
44 44
                 public function has(string $section): bool
45 45
                 {
46 46
                     return false;
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,8 @@
 block discarded – undo
40 40
         $finalizer->shouldReceive('addFinalizer')->once();
41 41
 
42 42
         $this->container->bind(ConfiguratorInterface::class, new ConfigManager(
43
-            new class() implements LoaderInterface {
43
+            new class() implements LoaderInterface
44
+            {
44 45
                 public function has(string $section): bool
45 46
                 {
46 47
                     return false;
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
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
         private readonly MonologConfig $config,
28 28
         ListenerRegistryInterface $listenerRegistry,
29 29
         private readonly FactoryInterface $factory
30
-    ) {
30
+    ){
31 31
         $this->eventHandler = new EventHandler($listenerRegistry, $config->getEventLevel());
32 32
     }
33 33
 
@@ -35,8 +35,8 @@  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
+            if ($this->default !== null){
40 40
                 // we should use only one default logger per system
41 41
                 return $this->default;
42 42
             }
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
     public function reset(): void
65 65
     {
66
-        if ($this->default instanceof ResettableInterface) {
66
+        if ($this->default instanceof ResettableInterface){
67 67
             $this->default->reset();
68 68
         }
69 69
     }
@@ -79,15 +79,15 @@  discard block
 block discarded – undo
79 79
         // always include default handler
80 80
         $handlers = [];
81 81
 
82
-        foreach ($this->config->getHandlers($channel) as $handler) {
83
-            if (!$handler instanceof Autowire) {
82
+        foreach ($this->config->getHandlers($channel) as $handler){
83
+            if (!$handler instanceof Autowire){
84 84
                 $handlers[] = $handler;
85 85
                 continue;
86 86
             }
87 87
 
88
-            try {
88
+            try{
89 89
                 $handlers[] = $handler->resolve($this->factory);
90
-            } catch (ContainerExceptionInterface $e) {
90
+            }catch (ContainerExceptionInterface $e){
91 91
                 throw new ConfigException($e->getMessage(), $e->getCode(), $e);
92 92
             }
93 93
         }
@@ -105,20 +105,20 @@  discard block
 block discarded – undo
105 105
     protected function getProcessors(string $channel): array
106 106
     {
107 107
         $processors = [];
108
-        foreach ($this->config->getProcessors($channel) as $processor) {
109
-            if (!$processor instanceof Autowire) {
108
+        foreach ($this->config->getProcessors($channel) as $processor){
109
+            if (!$processor instanceof Autowire){
110 110
                 $processors[] = $processor;
111 111
                 continue;
112 112
             }
113 113
 
114
-            try {
114
+            try{
115 115
                 $processors[] = $processor->resolve($this->factory);
116
-            } catch (ContainerExceptionInterface $e) {
116
+            }catch (ContainerExceptionInterface $e){
117 117
                 throw new ConfigException($e->getMessage(), $e->getCode(), $e);
118 118
             }
119 119
         }
120 120
 
121
-        if ($processors === []) {
121
+        if ($processors === []){
122 122
             $processors[] = new PsrLogMessageProcessor();
123 123
         }
124 124
 
Please login to merge, or discard this patch.
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.
src/Bridge/Monolog/src/EventHandler.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
         private readonly ListenerRegistryInterface $listenerRegistry,
16 16
         int $level = Logger::DEBUG,
17 17
         bool $bubble = true
18
-    ) {
18
+    ){
19 19
         parent::__construct($level, $bubble);
20 20
     }
21 21
 
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
             $record['context']
30 30
         );
31 31
 
32
-        foreach ($this->listenerRegistry->getListeners() as $listener) {
32
+        foreach ($this->listenerRegistry->getListeners() as $listener){
33 33
             $listener($e);
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
             $record['context']
30 30
         );
31 31
 
32
-        foreach ($this->listenerRegistry->getListeners() as $listener) {
32
+        foreach ($this->listenerRegistry->getListeners() as $listener)
33
+        {
33 34
             $listener($e);
34 35
         }
35 36
 
Please login to merge, or discard this patch.
src/Snapshots/tests/FileSnapshotTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     {
21 21
         $this->files = new Files();
22 22
         $this->fileSnapshot = new FileSnapshot(
23
-            __DIR__ . '/snapshots',
23
+            __DIR__.'/snapshots',
24 24
             1,
25 25
             Verbosity::DEBUG,
26 26
             new PlainRenderer(),
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
     protected function tearDown(): void
32 32
     {
33
-        $this->files->deleteDirectory(__DIR__ . '/snapshots');
33
+        $this->files->deleteDirectory(__DIR__.'/snapshots');
34 34
     }
35 35
 
36 36
     public function testCreate(): void
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         $this->assertStringContainsString('message', $s->getMessage());
45 45
         $this->assertStringContainsString(__FILE__, $s->getMessage());
46 46
         $this->assertStringContainsString('38', $s->getMessage());
47
-        $this->assertCount(1, $this->files->getFiles(__DIR__ . '/snapshots'));
47
+        $this->assertCount(1, $this->files->getFiles(__DIR__.'/snapshots'));
48 48
     }
49 49
 
50 50
     public function testCreateBiggerThanMaxFiles(): void
@@ -58,6 +58,6 @@  discard block
 block discarded – undo
58 58
         $this->assertSame($e, $s->getException());
59 59
         $this->assertSame($e2, $s2->getException());
60 60
 
61
-        $this->assertCount(1, $this->files->getFiles(__DIR__ . '/snapshots'));
61
+        $this->assertCount(1, $this->files->getFiles(__DIR__.'/snapshots'));
62 62
     }
63 63
 }
Please login to merge, or discard this patch.