Passed
Pull Request — master (#450)
by Kirill
05:42
created
src/Dumper/src/Renderer/ConsoleRenderer.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
      *
24 24
      * @var string
25 25
      */
26
-    protected $element = '%s%s' . Color::RESET;
26
+    protected $element = '%s%s'.Color::RESET;
27 27
 
28 28
     /**
29 29
      * Set of styles associated with different dumping properties.
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      */
63 63
     public function apply($element, string $type, string $context = ''): string
64 64
     {
65
-        if (!empty($style = $this->getStyle($type, $context))) {
65
+        if (!empty($style = $this->getStyle($type, $context))){
66 66
             return sprintf($this->element, $style, $element);
67 67
         }
68 68
 
@@ -87,15 +87,15 @@  discard block
 block discarded – undo
87 87
      */
88 88
     private function getStyle(string $type, string $context): string
89 89
     {
90
-        if (isset($this->styles[$type][$context])) {
90
+        if (isset($this->styles[$type][$context])){
91 91
             return $this->styles[$type][$context];
92 92
         }
93 93
 
94
-        if (isset($this->styles[$type]['common'])) {
94
+        if (isset($this->styles[$type]['common'])){
95 95
             return $this->styles[$type]['common'];
96 96
         }
97 97
 
98
-        if (isset($this->styles[$type]) && is_string($this->styles[$type])) {
98
+        if (isset($this->styles[$type]) && is_string($this->styles[$type])){
99 99
             return $this->styles[$type];
100 100
         }
101 101
 
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -62,7 +62,8 @@  discard block
 block discarded – undo
62 62
      */
63 63
     public function apply($element, string $type, string $context = ''): string
64 64
     {
65
-        if (!empty($style = $this->getStyle($type, $context))) {
65
+        if (!empty($style = $this->getStyle($type, $context)))
66
+        {
66 67
             return sprintf($this->element, $style, $element);
67 68
         }
68 69
 
@@ -87,15 +88,18 @@  discard block
 block discarded – undo
87 88
      */
88 89
     private function getStyle(string $type, string $context): string
89 90
     {
90
-        if (isset($this->styles[$type][$context])) {
91
+        if (isset($this->styles[$type][$context]))
92
+        {
91 93
             return $this->styles[$type][$context];
92 94
         }
93 95
 
94
-        if (isset($this->styles[$type]['common'])) {
96
+        if (isset($this->styles[$type]['common']))
97
+        {
95 98
             return $this->styles[$type]['common'];
96 99
         }
97 100
 
98
-        if (isset($this->styles[$type]) && is_string($this->styles[$type])) {
101
+        if (isset($this->styles[$type]) && is_string($this->styles[$type]))
102
+        {
99 103
             return $this->styles[$type];
100 104
         }
101 105
 
Please login to merge, or discard this patch.
src/Dumper/src/Renderer/AbstractRenderer.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
      */
43 43
     public function indent(int $level): string
44 44
     {
45
-        if ($level == 0) {
45
+        if ($level == 0){
46 46
             return '';
47 47
         }
48 48
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,8 @@
 block discarded – undo
42 42
      */
43 43
     public function indent(int $level): string
44 44
     {
45
-        if ($level == 0) {
45
+        if ($level == 0)
46
+        {
46 47
             return '';
47 48
         }
48 49
 
Please login to merge, or discard this patch.
src/Dumper/src/Renderer/HtmlRenderer.php 3 patches
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     /**
22 22
      * Default coloring schema.
23 23
      */
24
-    public const DEFAULT = [
24
+    public const default = [
25 25
         'body'     => '<pre style="background-color: white; font-family: monospace;">%s</pre>',
26 26
         'element'  => '<span style="%s;">%s</span>',
27 27
         'indent'   => '&middot;    ',
@@ -101,12 +101,12 @@  discard block
 block discarded – undo
101 101
      *
102 102
      * @var array
103 103
      */
104
-    protected $style = self::DEFAULT;
104
+    protected $style = self::default;
105 105
 
106 106
     /**
107 107
      * @param array $style
108 108
      */
109
-    public function __construct(array $style = self::DEFAULT)
109
+    public function __construct(array $style = self::default)
110 110
     {
111 111
         $this->style = $style;
112 112
     }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      */
117 117
     public function apply($element, string $type, string $context = ''): string
118 118
     {
119
-        if (!empty($style = $this->getStyle($type, $context))) {
119
+        if (!empty($style = $this->getStyle($type, $context))){
120 120
             return sprintf($this->style['element'], $style, $element);
121 121
         }
122 122
 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
      */
137 137
     public function indent(int $level): string
138 138
     {
139
-        if ($level == 0) {
139
+        if ($level == 0){
140 140
             return '';
141 141
         }
142 142
 
@@ -161,15 +161,15 @@  discard block
 block discarded – undo
161 161
      */
162 162
     private function getStyle(string $type, string $context): string
163 163
     {
164
-        if (isset($this->style[$type][$context])) {
164
+        if (isset($this->style[$type][$context])){
165 165
             return $this->style[$type][$context];
166 166
         }
167 167
 
168
-        if (isset($this->style[$type]['common'])) {
168
+        if (isset($this->style[$type]['common'])){
169 169
             return $this->style[$type]['common'];
170 170
         }
171 171
 
172
-        if (isset($this->style[$type]) && is_string($this->style[$type])) {
172
+        if (isset($this->style[$type]) && is_string($this->style[$type])){
173 173
             return $this->style[$type];
174 174
         }
175 175
 
Please login to merge, or discard this patch.
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -116,7 +116,8 @@  discard block
 block discarded – undo
116 116
      */
117 117
     public function apply($element, string $type, string $context = ''): string
118 118
     {
119
-        if (!empty($style = $this->getStyle($type, $context))) {
119
+        if (!empty($style = $this->getStyle($type, $context)))
120
+        {
120 121
             return sprintf($this->style['element'], $style, $element);
121 122
         }
122 123
 
@@ -136,7 +137,8 @@  discard block
 block discarded – undo
136 137
      */
137 138
     public function indent(int $level): string
138 139
     {
139
-        if ($level == 0) {
140
+        if ($level == 0)
141
+        {
140 142
             return '';
141 143
         }
142 144
 
@@ -161,15 +163,18 @@  discard block
 block discarded – undo
161 163
      */
162 164
     private function getStyle(string $type, string $context): string
163 165
     {
164
-        if (isset($this->style[$type][$context])) {
166
+        if (isset($this->style[$type][$context]))
167
+        {
165 168
             return $this->style[$type][$context];
166 169
         }
167 170
 
168
-        if (isset($this->style[$type]['common'])) {
171
+        if (isset($this->style[$type]['common']))
172
+        {
169 173
             return $this->style[$type]['common'];
170 174
         }
171 175
 
172
-        if (isset($this->style[$type]) && is_string($this->style[$type])) {
176
+        if (isset($this->style[$type]) && is_string($this->style[$type]))
177
+        {
173 178
             return $this->style[$type];
174 179
         }
175 180
 
Please login to merge, or discard this patch.
src/Logger/src/LogFactory.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
             $context
56 56
         );
57 57
 
58
-        foreach ($this->listenedRegistry->getListeners() as $listener) {
58
+        foreach ($this->listenedRegistry->getListeners() as $listener){
59 59
             call_user_func($listener, $e);
60 60
         }
61 61
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,8 @@
 block discarded – undo
55 55
             $context
56 56
         );
57 57
 
58
-        foreach ($this->listenedRegistry->getListeners() as $listener) {
58
+        foreach ($this->listenedRegistry->getListeners() as $listener)
59
+        {
59 60
             call_user_func($listener, $e);
60 61
         }
61 62
     }
Please login to merge, or discard this patch.
src/Logger/src/ListenerRegistry.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
      */
25 25
     public function addListener(callable $listener): void
26 26
     {
27
-        if (!array_search($listener, $this->listeners, true)) {
27
+        if (!array_search($listener, $this->listeners, true)){
28 28
             $this->listeners[] = $listener;
29 29
         }
30 30
     }
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     public function removeListener(callable $listener): void
36 36
     {
37 37
         $key = array_search($listener, $this->listeners, true);
38
-        if ($key !== null) {
38
+        if ($key !== null){
39 39
             unset($this->listeners[$key]);
40 40
         }
41 41
     }
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,8 @@  discard block
 block discarded – undo
24 24
      */
25 25
     public function addListener(callable $listener): void
26 26
     {
27
-        if (!array_search($listener, $this->listeners, true)) {
27
+        if (!array_search($listener, $this->listeners, true))
28
+        {
28 29
             $this->listeners[] = $listener;
29 30
         }
30 31
     }
@@ -35,7 +36,8 @@  discard block
 block discarded – undo
35 36
     public function removeListener(callable $listener): void
36 37
     {
37 38
         $key = array_search($listener, $this->listeners, true);
38
-        if ($key !== null) {
39
+        if ($key !== null)
40
+        {
39 41
             unset($this->listeners[$key]);
40 42
         }
41 43
     }
Please login to merge, or discard this patch.
src/Logger/src/Event/LogEvent.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
         string $level,
42 42
         string $message,
43 43
         array $context = []
44
-    ) {
44
+    ){
45 45
         $this->time = $time;
46 46
         $this->channel = $channel;
47 47
         $this->level = $level;
Please login to merge, or discard this patch.
src/Logger/src/Traits/LoggerTrait.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
      */
43 43
     protected function getLogger(string $channel = null): LoggerInterface
44 44
     {
45
-        if ($channel !== null) {
45
+        if ($channel !== null){
46 46
             return $this->allocateLogger($channel);
47 47
         }
48 48
 
49
-        if ($this->logger !== null) {
49
+        if ($this->logger !== null){
50 50
             return $this->logger;
51 51
         }
52 52
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     private function allocateLogger(string $channel): LoggerInterface
64 64
     {
65 65
         $container = ContainerScope::getContainer();
66
-        if (empty($container) || !$container->has(LogsInterface::class)) {
66
+        if (empty($container) || !$container->has(LogsInterface::class)){
67 67
             return $this->logger ?? new NullLogger();
68 68
         }
69 69
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,11 +42,13 @@  discard block
 block discarded – undo
42 42
      */
43 43
     protected function getLogger(string $channel = null): LoggerInterface
44 44
     {
45
-        if ($channel !== null) {
45
+        if ($channel !== null)
46
+        {
46 47
             return $this->allocateLogger($channel);
47 48
         }
48 49
 
49
-        if ($this->logger !== null) {
50
+        if ($this->logger !== null)
51
+        {
50 52
             return $this->logger;
51 53
         }
52 54
 
@@ -63,7 +65,8 @@  discard block
 block discarded – undo
63 65
     private function allocateLogger(string $channel): LoggerInterface
64 66
     {
65 67
         $container = ContainerScope::getContainer();
66
-        if (empty($container) || !$container->has(LogsInterface::class)) {
68
+        if (empty($container) || !$container->has(LogsInterface::class))
69
+        {
67 70
             return $this->logger ?? new NullLogger();
68 71
         }
69 72
 
Please login to merge, or discard this patch.
src/Debug/src/State.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,8 +34,8 @@
 block discarded – undo
34 34
     public function setTags(array $tags): void
35 35
     {
36 36
         $setTags = [];
37
-        foreach ($tags as $key => $value) {
38
-            if (!is_string($value)) {
37
+        foreach ($tags as $key => $value){
38
+            if (!is_string($value)){
39 39
                 throw new StateException(sprintf(
40 40
                     'Invalid tag value, string expected got %s',
41 41
                     is_object($value) ? get_class($value) : gettype($value)
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,8 +34,10 @@
 block discarded – undo
34 34
     public function setTags(array $tags): void
35 35
     {
36 36
         $setTags = [];
37
-        foreach ($tags as $key => $value) {
38
-            if (!is_string($value)) {
37
+        foreach ($tags as $key => $value)
38
+        {
39
+            if (!is_string($value))
40
+            {
39 41
                 throw new StateException(sprintf(
40 42
                     'Invalid tag value, string expected got %s',
41 43
                     is_object($value) ? get_class($value) : gettype($value)
Please login to merge, or discard this patch.
src/Boot/tests/MemoryTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,17 +21,17 @@  discard block
 block discarded – undo
21 21
     {
22 22
         $core = TestCore::init([
23 23
             'root'  => __DIR__,
24
-            'cache' => __DIR__ . '/cache'
24
+            'cache' => __DIR__.'/cache'
25 25
         ]);
26 26
 
27 27
         /** @var MemoryInterface $memory */
28 28
         $memory = $core->getContainer()->get(MemoryInterface::class);
29 29
 
30 30
         $memory->saveData('test', 'data');
31
-        $this->assertFileExists(__DIR__ . '/cache/test.php');
31
+        $this->assertFileExists(__DIR__.'/cache/test.php');
32 32
         $this->assertSame('data', $memory->loadData('test'));
33 33
 
34
-        unlink(__DIR__ . '/cache/test.php');
34
+        unlink(__DIR__.'/cache/test.php');
35 35
         $this->assertNull($memory->loadData('test'));
36 36
     }
37 37
 
@@ -39,16 +39,16 @@  discard block
 block discarded – undo
39 39
     {
40 40
         $core = TestCore::init([
41 41
             'root'  => __DIR__,
42
-            'cache' => __DIR__ . '/cache'
42
+            'cache' => __DIR__.'/cache'
43 43
         ]);
44 44
 
45 45
         /** @var MemoryInterface $memory */
46 46
         $memory = $core->getContainer()->get(MemoryInterface::class);
47 47
 
48
-        file_put_contents(__DIR__ . '/cache/test.php', '<?php broken');
48
+        file_put_contents(__DIR__.'/cache/test.php', '<?php broken');
49 49
         $this->assertNull($memory->loadData('test'));
50 50
 
51
-        unlink(__DIR__ . '/cache/test.php');
51
+        unlink(__DIR__.'/cache/test.php');
52 52
         $this->assertNull($memory->loadData('test'));
53 53
     }
54 54
 }
Please login to merge, or discard this patch.