Passed
Push — master ( 2291e3...cd7158 )
by Anton
03:34
created
src/Reactor/src/ClassDeclaration.php 2 patches
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
         string $extends = '',
62 62
         array $interfaces = [],
63 63
         string $comment = ''
64
-    ) {
64
+    ){
65 65
         $this->setName($name);
66 66
 
67
-        if (! empty($extends)) {
67
+        if (!empty($extends)){
68 68
             $this->setExtends($extends);
69 69
         }
70 70
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
     public function setInterfaces(array $interfaces): ClassDeclaration
158 158
     {
159 159
         $this->interfaces = [];
160
-        foreach ($interfaces as $interface) {
160
+        foreach ($interfaces as $interface){
161 161
             $this->addInterface($interface);
162 162
         }
163 163
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
     public function setTraits(array $traits): ClassDeclaration
204 204
     {
205 205
         $this->traits = [];
206
-        foreach ($traits as $trait) {
206
+        foreach ($traits as $trait){
207 207
             $this->addTrait($trait);
208 208
         }
209 209
 
@@ -293,30 +293,30 @@  discard block
 block discarded – undo
293 293
     {
294 294
         $result = '';
295 295
 
296
-        if (! $this->docComment->isEmpty()) {
297
-            $result .= $this->docComment->render($indentLevel) . "\n";
296
+        if (!$this->docComment->isEmpty()){
297
+            $result .= $this->docComment->render($indentLevel)."\n";
298 298
         }
299 299
 
300 300
         //Class header
301 301
         $header = "class {$this->getName()}";
302 302
 
303 303
         //Rendering extends
304
-        if (! empty($this->extends)) {
304
+        if (!empty($this->extends)){
305 305
             $header .= " extends {$this->extends}";
306 306
         }
307 307
 
308
-        if (! empty($this->interfaces)) {
308
+        if (!empty($this->interfaces)){
309 309
             $interfaces = implode(', ', array_keys($this->interfaces));
310 310
             $header .= " implements {$interfaces}";
311 311
         }
312 312
 
313
-        $result .= $this->addIndent($header, $indentLevel) . "\n";
314
-        $result .= $this->addIndent('{', $indentLevel) . "\n";
313
+        $result .= $this->addIndent($header, $indentLevel)."\n";
314
+        $result .= $this->addIndent('{', $indentLevel)."\n";
315 315
 
316 316
         //Rendering class body
317 317
         $result .= $this->renderBody($indentLevel);
318 318
 
319
-        $result = rtrim($result, "\n") . "\n";
319
+        $result = rtrim($result, "\n")."\n";
320 320
         $result .= $this->addIndent('}', $indentLevel);
321 321
 
322 322
         return $result;
@@ -329,20 +329,20 @@  discard block
 block discarded – undo
329 329
     protected function renderBody(int $indentLevel): string
330 330
     {
331 331
         $result = '';
332
-        if (! empty($this->traits)) {
333
-            $result .= $this->renderTraits($indentLevel + 1) . "\n\n";
332
+        if (!empty($this->traits)){
333
+            $result .= $this->renderTraits($indentLevel + 1)."\n\n";
334 334
         }
335 335
 
336
-        if (! $this->constants->isEmpty()) {
337
-            $result .= $this->constants->render($indentLevel + 1) . "\n\n";
336
+        if (!$this->constants->isEmpty()){
337
+            $result .= $this->constants->render($indentLevel + 1)."\n\n";
338 338
         }
339 339
 
340
-        if (! $this->properties->isEmpty()) {
341
-            $result .= $this->properties->render($indentLevel + 1) . "\n\n";
340
+        if (!$this->properties->isEmpty()){
341
+            $result .= $this->properties->render($indentLevel + 1)."\n\n";
342 342
         }
343 343
 
344
-        if (! $this->methods->isEmpty()) {
345
-            $result .= $this->methods->render($indentLevel + 1) . "\n\n";
344
+        if (!$this->methods->isEmpty()){
345
+            $result .= $this->methods->render($indentLevel + 1)."\n\n";
346 346
         }
347 347
 
348 348
         return $result;
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
     private function renderTraits(int $indentLevel = 0): string
356 356
     {
357 357
         $lines = [];
358
-        foreach ($this->traits as $class => $options) {
358
+        foreach ($this->traits as $class => $options){
359 359
             $lines[] = $this->addIndent("use {$class};", $indentLevel);
360 360
         }
361 361
 
Please login to merge, or discard this patch.
Braces   +22 added lines, -11 removed lines patch added patch discarded remove patch
@@ -64,7 +64,8 @@  discard block
 block discarded – undo
64 64
     ) {
65 65
         $this->setName($name);
66 66
 
67
-        if (! empty($extends)) {
67
+        if (! empty($extends))
68
+        {
68 69
             $this->setExtends($extends);
69 70
         }
70 71
 
@@ -157,7 +158,8 @@  discard block
 block discarded – undo
157 158
     public function setInterfaces(array $interfaces): ClassDeclaration
158 159
     {
159 160
         $this->interfaces = [];
160
-        foreach ($interfaces as $interface) {
161
+        foreach ($interfaces as $interface)
162
+        {
161 163
             $this->addInterface($interface);
162 164
         }
163 165
 
@@ -203,7 +205,8 @@  discard block
 block discarded – undo
203 205
     public function setTraits(array $traits): ClassDeclaration
204 206
     {
205 207
         $this->traits = [];
206
-        foreach ($traits as $trait) {
208
+        foreach ($traits as $trait)
209
+        {
207 210
             $this->addTrait($trait);
208 211
         }
209 212
 
@@ -293,7 +296,8 @@  discard block
 block discarded – undo
293 296
     {
294 297
         $result = '';
295 298
 
296
-        if (! $this->docComment->isEmpty()) {
299
+        if (! $this->docComment->isEmpty())
300
+        {
297 301
             $result .= $this->docComment->render($indentLevel) . "\n";
298 302
         }
299 303
 
@@ -301,11 +305,13 @@  discard block
 block discarded – undo
301 305
         $header = "class {$this->getName()}";
302 306
 
303 307
         //Rendering extends
304
-        if (! empty($this->extends)) {
308
+        if (! empty($this->extends))
309
+        {
305 310
             $header .= " extends {$this->extends}";
306 311
         }
307 312
 
308
-        if (! empty($this->interfaces)) {
313
+        if (! empty($this->interfaces))
314
+        {
309 315
             $interfaces = implode(', ', array_keys($this->interfaces));
310 316
             $header .= " implements {$interfaces}";
311 317
         }
@@ -329,19 +335,23 @@  discard block
 block discarded – undo
329 335
     protected function renderBody(int $indentLevel): string
330 336
     {
331 337
         $result = '';
332
-        if (! empty($this->traits)) {
338
+        if (! empty($this->traits))
339
+        {
333 340
             $result .= $this->renderTraits($indentLevel + 1) . "\n\n";
334 341
         }
335 342
 
336
-        if (! $this->constants->isEmpty()) {
343
+        if (! $this->constants->isEmpty())
344
+        {
337 345
             $result .= $this->constants->render($indentLevel + 1) . "\n\n";
338 346
         }
339 347
 
340
-        if (! $this->properties->isEmpty()) {
348
+        if (! $this->properties->isEmpty())
349
+        {
341 350
             $result .= $this->properties->render($indentLevel + 1) . "\n\n";
342 351
         }
343 352
 
344
-        if (! $this->methods->isEmpty()) {
353
+        if (! $this->methods->isEmpty())
354
+        {
345 355
             $result .= $this->methods->render($indentLevel + 1) . "\n\n";
346 356
         }
347 357
 
@@ -355,7 +365,8 @@  discard block
 block discarded – undo
355 365
     private function renderTraits(int $indentLevel = 0): string
356 366
     {
357 367
         $lines = [];
358
-        foreach ($this->traits as $class => $options) {
368
+        foreach ($this->traits as $class => $options)
369
+        {
359 370
             $lines[] = $this->addIndent("use {$class};", $indentLevel);
360 371
         }
361 372
 
Please login to merge, or discard this patch.
src/Reactor/src/Traits/AccessTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
             AbstractDeclaration::ACCESS_PROTECTED,
39 39
             AbstractDeclaration::ACCESS_PUBLIC
40 40
             ], true)
41
-        ) {
41
+        ){
42 42
             throw new ReactorException("Invalid declaration level '{$access}'");
43 43
         }
44 44
 
Please login to merge, or discard this patch.
src/Reactor/src/Traits/CommentTrait.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,10 +42,10 @@  discard block
 block discarded – undo
42 42
      */
43 43
     public function setComment($comment): self
44 44
     {
45
-        if (!empty($comment)) {
46
-            if (is_array($comment)) {
45
+        if (!empty($comment)){
46
+            if (is_array($comment)){
47 47
                 $this->docComment->setLines($comment);
48
-            } elseif (is_string($comment)) {
48
+            } elseif (is_string($comment)){
49 49
                 $this->docComment->setString($comment);
50 50
             }
51 51
         }
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      */
61 61
     private function initComment($comment): void
62 62
     {
63
-        if (empty($this->docComment)) {
63
+        if (empty($this->docComment)){
64 64
             $this->docComment = new Comment();
65 65
         }
66 66
 
Please login to merge, or discard this patch.
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,10 +42,14 @@  discard block
 block discarded – undo
42 42
      */
43 43
     public function setComment($comment): self
44 44
     {
45
-        if (!empty($comment)) {
46
-            if (is_array($comment)) {
45
+        if (!empty($comment))
46
+        {
47
+            if (is_array($comment))
48
+            {
47 49
                 $this->docComment->setLines($comment);
48
-            } elseif (is_string($comment)) {
50
+            }
51
+            elseif (is_string($comment))
52
+            {
49 53
                 $this->docComment->setString($comment);
50 54
             }
51 55
         }
@@ -60,7 +64,8 @@  discard block
 block discarded – undo
60 64
      */
61 65
     private function initComment($comment): void
62 66
     {
63
-        if (empty($this->docComment)) {
67
+        if (empty($this->docComment))
68
+        {
64 69
             $this->docComment = new Comment();
65 70
         }
66 71
 
Please login to merge, or discard this patch.
src/Reactor/src/Traits/UsesTrait.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      */
57 57
     public function addUses(array $uses): self
58 58
     {
59
-        foreach ($uses as $class => $alias) {
59
+        foreach ($uses as $class => $alias){
60 60
             $this->addUse($class, $alias);
61 61
         }
62 62
 
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
     private function renderUses(int $indentLevel = 0): string
113 113
     {
114 114
         $lines = [];
115
-        foreach ($this->getUses() as $class => $alias) {
115
+        foreach ($this->getUses() as $class => $alias){
116 116
             $line = "use {$class}";
117 117
 
118
-            if (!empty($alias)) {
118
+            if (!empty($alias)){
119 119
                 $line .= " as {$alias};";
120
-            } else {
120
+            }else{
121 121
                 $line .= ';';
122 122
             }
123 123
 
Please login to merge, or discard this patch.
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,7 +56,8 @@  discard block
 block discarded – undo
56 56
      */
57 57
     public function addUses(array $uses): self
58 58
     {
59
-        foreach ($uses as $class => $alias) {
59
+        foreach ($uses as $class => $alias)
60
+        {
60 61
             $this->addUse($class, $alias);
61 62
         }
62 63
 
@@ -112,12 +113,16 @@  discard block
 block discarded – undo
112 113
     private function renderUses(int $indentLevel = 0): string
113 114
     {
114 115
         $lines = [];
115
-        foreach ($this->getUses() as $class => $alias) {
116
+        foreach ($this->getUses() as $class => $alias)
117
+        {
116 118
             $line = "use {$class}";
117 119
 
118
-            if (!empty($alias)) {
120
+            if (!empty($alias))
121
+            {
119 122
                 $line .= " as {$alias};";
120
-            } else {
123
+            }
124
+            else
125
+            {
121 126
                 $line .= ';';
122 127
             }
123 128
 
Please login to merge, or discard this patch.
src/Reactor/src/Serializer.php 2 patches
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public function serialize($value): string
37 37
     {
38
-        if (is_array($value)) {
38
+        if (is_array($value)){
39 39
             return $this->packArray($value);
40 40
         }
41 41
 
@@ -50,49 +50,49 @@  discard block
 block discarded – undo
50 50
      */
51 51
     protected function packArray(array $array, int $level = 0): string
52 52
     {
53
-        if ($array === []) {
53
+        if ($array === []){
54 54
             return '[]';
55 55
         }
56 56
         //Delimiters between rows and sub-arrays.
57
-        $subIndent = "\n" . str_repeat(self::INDENT, $level + 2);
58
-        $keyIndent = "\n" . str_repeat(self::INDENT, $level + 1);
57
+        $subIndent = "\n".str_repeat(self::INDENT, $level + 2);
58
+        $keyIndent = "\n".str_repeat(self::INDENT, $level + 1);
59 59
         //No keys for associated array
60 60
         $associated = array_diff_key($array, array_keys(array_keys($array)));
61 61
         $result = [];
62 62
         $innerIndent = 0;
63
-        if (!empty($associated)) {
64
-            foreach ($array as $key => $value) {
63
+        if (!empty($associated)){
64
+            foreach ($array as $key => $value){
65 65
                 //Based on biggest key length
66 66
                 $innerIndent = max(strlen(var_export($key, true)), $innerIndent);
67 67
             }
68 68
         }
69
-        foreach ($array as $key => $value) {
69
+        foreach ($array as $key => $value){
70 70
             $prefix = '';
71
-            if (!empty($associated)) {
71
+            if (!empty($associated)){
72 72
                 //Key prefix
73 73
                 $prefix = str_pad(
74 74
                     var_export($key, true),
75 75
                     $innerIndent,
76 76
                     ' ',
77 77
                     STR_PAD_RIGHT
78
-                ) . ' => ';
78
+                ).' => ';
79 79
             }
80
-            if (!is_array($value)) {
81
-                $result[] = $prefix . $this->packValue($value);
80
+            if (!is_array($value)){
81
+                $result[] = $prefix.$this->packValue($value);
82 82
                 continue;
83 83
             }
84
-            if ($value === []) {
85
-                $result[] = $prefix . '[]';
84
+            if ($value === []){
85
+                $result[] = $prefix.'[]';
86 86
                 continue;
87 87
             }
88 88
             $subArray = $this->packArray($value, $level + 1);
89
-            $result[] = $prefix . "[{$subIndent}" . $subArray . "{$keyIndent}]";
89
+            $result[] = $prefix."[{$subIndent}".$subArray."{$keyIndent}]";
90 90
         }
91
-        if ($level !== 0) {
91
+        if ($level !== 0){
92 92
             return $result ? implode(",{$keyIndent}", $result) : '';
93 93
         }
94 94
 
95
-        return "[{$keyIndent}" . implode(",{$keyIndent}", $result) . "\n]";
95
+        return "[{$keyIndent}".implode(",{$keyIndent}", $result)."\n]";
96 96
     }
97 97
 
98 98
     /**
@@ -105,31 +105,31 @@  discard block
 block discarded – undo
105 105
      */
106 106
     protected function packValue($value): string
107 107
     {
108
-        if ($value instanceof DeclarationInterface) {
108
+        if ($value instanceof DeclarationInterface){
109 109
             //No indentation here
110 110
             return $value->render();
111 111
         }
112 112
 
113
-        if ($value === null) {
113
+        if ($value === null){
114 114
             return 'null';
115 115
         }
116 116
 
117
-        if (is_bool($value)) {
117
+        if (is_bool($value)){
118 118
             return ($value ? 'true' : 'false');
119 119
         }
120 120
 
121
-        if (is_object($value) && method_exists($value, '__set_state')) {
122
-            return '\\' . var_export($value, true);
121
+        if (is_object($value) && method_exists($value, '__set_state')){
122
+            return '\\'.var_export($value, true);
123 123
         }
124 124
 
125
-        if (!is_string($value) && !is_numeric($value)) {
125
+        if (!is_string($value) && !is_numeric($value)){
126 126
             throw new SerializeException('Unable to pack non scalar value');
127 127
         }
128 128
 
129
-        if (is_string($value) && class_exists($value)) {
129
+        if (is_string($value) && class_exists($value)){
130 130
             $reflection = new ReflectionClass($value);
131
-            if ($value === $reflection->getName()) {
132
-                return '\\' . $reflection->getName() . '::class';
131
+            if ($value === $reflection->getName()){
132
+                return '\\'.$reflection->getName().'::class';
133 133
             }
134 134
         }
135 135
 
Please login to merge, or discard this patch.
Braces   +32 added lines, -16 removed lines patch added patch discarded remove patch
@@ -35,7 +35,8 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public function serialize($value): string
37 37
     {
38
-        if (is_array($value)) {
38
+        if (is_array($value))
39
+        {
39 40
             return $this->packArray($value);
40 41
         }
41 42
 
@@ -50,7 +51,8 @@  discard block
 block discarded – undo
50 51
      */
51 52
     protected function packArray(array $array, int $level = 0): string
52 53
     {
53
-        if ($array === []) {
54
+        if ($array === [])
55
+        {
54 56
             return '[]';
55 57
         }
56 58
         //Delimiters between rows and sub-arrays.
@@ -60,15 +62,19 @@  discard block
 block discarded – undo
60 62
         $associated = array_diff_key($array, array_keys(array_keys($array)));
61 63
         $result = [];
62 64
         $innerIndent = 0;
63
-        if (!empty($associated)) {
64
-            foreach ($array as $key => $value) {
65
+        if (!empty($associated))
66
+        {
67
+            foreach ($array as $key => $value)
68
+            {
65 69
                 //Based on biggest key length
66 70
                 $innerIndent = max(strlen(var_export($key, true)), $innerIndent);
67 71
             }
68 72
         }
69
-        foreach ($array as $key => $value) {
73
+        foreach ($array as $key => $value)
74
+        {
70 75
             $prefix = '';
71
-            if (!empty($associated)) {
76
+            if (!empty($associated))
77
+            {
72 78
                 //Key prefix
73 79
                 $prefix = str_pad(
74 80
                     var_export($key, true),
@@ -77,18 +83,21 @@  discard block
 block discarded – undo
77 83
                     STR_PAD_RIGHT
78 84
                 ) . ' => ';
79 85
             }
80
-            if (!is_array($value)) {
86
+            if (!is_array($value))
87
+            {
81 88
                 $result[] = $prefix . $this->packValue($value);
82 89
                 continue;
83 90
             }
84
-            if ($value === []) {
91
+            if ($value === [])
92
+            {
85 93
                 $result[] = $prefix . '[]';
86 94
                 continue;
87 95
             }
88 96
             $subArray = $this->packArray($value, $level + 1);
89 97
             $result[] = $prefix . "[{$subIndent}" . $subArray . "{$keyIndent}]";
90 98
         }
91
-        if ($level !== 0) {
99
+        if ($level !== 0)
100
+        {
92 101
             return $result ? implode(",{$keyIndent}", $result) : '';
93 102
         }
94 103
 
@@ -105,30 +114,37 @@  discard block
 block discarded – undo
105 114
      */
106 115
     protected function packValue($value): string
107 116
     {
108
-        if ($value instanceof DeclarationInterface) {
117
+        if ($value instanceof DeclarationInterface)
118
+        {
109 119
             //No indentation here
110 120
             return $value->render();
111 121
         }
112 122
 
113
-        if ($value === null) {
123
+        if ($value === null)
124
+        {
114 125
             return 'null';
115 126
         }
116 127
 
117
-        if (is_bool($value)) {
128
+        if (is_bool($value))
129
+        {
118 130
             return ($value ? 'true' : 'false');
119 131
         }
120 132
 
121
-        if (is_object($value) && method_exists($value, '__set_state')) {
133
+        if (is_object($value) && method_exists($value, '__set_state'))
134
+        {
122 135
             return '\\' . var_export($value, true);
123 136
         }
124 137
 
125
-        if (!is_string($value) && !is_numeric($value)) {
138
+        if (!is_string($value) && !is_numeric($value))
139
+        {
126 140
             throw new SerializeException('Unable to pack non scalar value');
127 141
         }
128 142
 
129
-        if (is_string($value) && class_exists($value)) {
143
+        if (is_string($value) && class_exists($value))
144
+        {
130 145
             $reflection = new ReflectionClass($value);
131
-            if ($value === $reflection->getName()) {
146
+            if ($value === $reflection->getName())
147
+            {
132 148
                 return '\\' . $reflection->getName() . '::class';
133 149
             }
134 150
         }
Please login to merge, or discard this patch.
src/Reactor/src/Partial/Comment.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
      */
39 39
     public function render(int $indentLevel = 0): string
40 40
     {
41
-        if ($this->isEmpty()) {
41
+        if ($this->isEmpty()){
42 42
             return '';
43 43
         }
44 44
 
45 45
         $result = $this->addIndent("/**\n", $indentLevel);
46
-        foreach ($this->getLines() as $line) {
46
+        foreach ($this->getLines() as $line){
47 47
             $result .= $this->addIndent(" * {$line}\n", $indentLevel);
48 48
         }
49 49
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     protected function prepareLine(string $line): ?string
59 59
     {
60 60
         $line = trim($line);
61
-        if (in_array($line, ['/*', '/**', '*/'], true)) {
61
+        if (in_array($line, ['/*', '/**', '*/'], true)){
62 62
             return null;
63 63
         }
64 64
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,12 +38,14 @@  discard block
 block discarded – undo
38 38
      */
39 39
     public function render(int $indentLevel = 0): string
40 40
     {
41
-        if ($this->isEmpty()) {
41
+        if ($this->isEmpty())
42
+        {
42 43
             return '';
43 44
         }
44 45
 
45 46
         $result = $this->addIndent("/**\n", $indentLevel);
46
-        foreach ($this->getLines() as $line) {
47
+        foreach ($this->getLines() as $line)
48
+        {
47 49
             $result .= $this->addIndent(" * {$line}\n", $indentLevel);
48 50
         }
49 51
 
@@ -58,7 +60,8 @@  discard block
 block discarded – undo
58 60
     protected function prepareLine(string $line): ?string
59 61
     {
60 62
         $line = trim($line);
61
-        if (in_array($line, ['/*', '/**', '*/'], true)) {
63
+        if (in_array($line, ['/*', '/**', '*/'], true))
64
+        {
62 65
             return null;
63 66
         }
64 67
 
Please login to merge, or discard this patch.
src/Reactor/src/Partial/Constant.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -89,18 +89,18 @@  discard block
 block discarded – undo
89 89
     public function render(int $indentLevel = 0): string
90 90
     {
91 91
         $result = '';
92
-        if (!$this->docComment->isEmpty()) {
93
-            $result .= $this->docComment->render($indentLevel) . "\n";
92
+        if (!$this->docComment->isEmpty()){
93
+            $result .= $this->docComment->render($indentLevel)."\n";
94 94
         }
95 95
 
96 96
         $result .= $this->addIndent("{$this->access} const {$this->getName()} = ", $indentLevel);
97 97
 
98 98
         $value = $this->getSerializer()->serialize($this->value);
99
-        if (is_array($this->value)) {
99
+        if (is_array($this->value)){
100 100
             $value = $this->mountIndents($value, $indentLevel);
101 101
         }
102 102
 
103
-        return $result . "{$value};";
103
+        return $result."{$value};";
104 104
     }
105 105
 
106 106
     /**
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     private function mountIndents(string $serialized, int $indentLevel): string
114 114
     {
115 115
         $lines = explode("\n", $serialized);
116
-        foreach ($lines as &$line) {
116
+        foreach ($lines as &$line){
117 117
             $line = $this->addIndent($line, $indentLevel);
118 118
             unset($line);
119 119
         }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -89,14 +89,16 @@  discard block
 block discarded – undo
89 89
     public function render(int $indentLevel = 0): string
90 90
     {
91 91
         $result = '';
92
-        if (!$this->docComment->isEmpty()) {
92
+        if (!$this->docComment->isEmpty())
93
+        {
93 94
             $result .= $this->docComment->render($indentLevel) . "\n";
94 95
         }
95 96
 
96 97
         $result .= $this->addIndent("{$this->access} const {$this->getName()} = ", $indentLevel);
97 98
 
98 99
         $value = $this->getSerializer()->serialize($this->value);
99
-        if (is_array($this->value)) {
100
+        if (is_array($this->value))
101
+        {
100 102
             $value = $this->mountIndents($value, $indentLevel);
101 103
         }
102 104
 
@@ -113,7 +115,8 @@  discard block
 block discarded – undo
113 115
     private function mountIndents(string $serialized, int $indentLevel): string
114 116
     {
115 117
         $lines = explode("\n", $serialized);
116
-        foreach ($lines as &$line) {
118
+        foreach ($lines as &$line)
119
+        {
117 120
             $line = $this->addIndent($line, $indentLevel);
118 121
             unset($line);
119 122
         }
Please login to merge, or discard this patch.
src/Reactor/src/Partial/Parameter.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -148,16 +148,16 @@
 block discarded – undo
148 148
     public function render(int $indentLevel = 0): string
149 149
     {
150 150
         $type = '';
151
-        if (!empty($this->type)) {
152
-            $type = $this->type . ' ';
151
+        if (!empty($this->type)){
152
+            $type = $this->type.' ';
153 153
         }
154 154
 
155
-        $result = $type . ($this->pdb ? '&' : '') . '$' . $this->getName();
155
+        $result = $type.($this->pdb ? '&' : '').'$'.$this->getName();
156 156
 
157
-        if (!$this->isOptional) {
157
+        if (!$this->isOptional){
158 158
             return $result;
159 159
         }
160 160
 
161
-        return $result . ' = ' . $this->getSerializer()->serialize($this->defaultValue);
161
+        return $result.' = '.$this->getSerializer()->serialize($this->defaultValue);
162 162
     }
163 163
 }
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -148,13 +148,15 @@
 block discarded – undo
148 148
     public function render(int $indentLevel = 0): string
149 149
     {
150 150
         $type = '';
151
-        if (!empty($this->type)) {
151
+        if (!empty($this->type))
152
+        {
152 153
             $type = $this->type . ' ';
153 154
         }
154 155
 
155 156
         $result = $type . ($this->pdb ? '&' : '') . '$' . $this->getName();
156 157
 
157
-        if (!$this->isOptional) {
158
+        if (!$this->isOptional)
159
+        {
158 160
             return $result;
159 161
         }
160 162
 
Please login to merge, or discard this patch.
src/Reactor/src/Partial/Directives.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,10 +31,10 @@
 block discarded – undo
31 31
      */
32 32
     public function render(int $indentLevel = 0): string
33 33
     {
34
-        if (empty($this->directives)) {
34
+        if (empty($this->directives)){
35 35
             return '';
36 36
         }
37 37
 
38
-        return 'declare(' . implode(', ', $this->directives) . ');';
38
+        return 'declare('.implode(', ', $this->directives).');';
39 39
     }
40 40
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,8 @@
 block discarded – undo
31 31
      */
32 32
     public function render(int $indentLevel = 0): string
33 33
     {
34
-        if (empty($this->directives)) {
34
+        if (empty($this->directives))
35
+        {
35 36
             return '';
36 37
         }
37 38
 
Please login to merge, or discard this patch.