Test Failed
Pull Request — master (#124)
by Mirocow
16:46 queued 01:48
created
src/Env.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@
 block discarded – undo
9 9
     public static function get(string $key, $default = null): callable
10 10
     {
11 11
         if (count(func_get_args()) === 2) {
12
-            return static fn () => $_ENV[$key] ?? $default;
12
+            return static fn() => $_ENV[$key] ?? $default;
13 13
         }
14 14
 
15
-        return static fn () => $_ENV[$key];
15
+        return static fn() => $_ENV[$key];
16 16
     }
17 17
 }
Please login to merge, or discard this patch.
src/Reader/PhpReader.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
         $builder = $this->builder;
24 24
 
25 25
         /** @var Builder $result */
26
-        $result = static function (array $params) use ($builder) {
26
+        $result = static function(array $params) use ($builder) {
27 27
             $fileName = func_get_arg(1);
28 28
 
29 29
             $parser = (new ParserFactory())->create(ParserFactory::PREFER_PHP7);
@@ -33,11 +33,11 @@  discard block
 block discarded – undo
33 33
                 $ast = $parser->parse($code);
34 34
 
35 35
                 /** @var Stmt $node */
36
-                foreach ($ast as $node){
37
-                    if(isset($node->type) && $node->type == Use_::TYPE_NORMAL and !empty($node->uses)){
36
+                foreach ($ast as $node) {
37
+                    if (isset($node->type) && $node->type == Use_::TYPE_NORMAL and !empty($node->uses)) {
38 38
                         foreach ($node->uses as $use) {
39 39
                             $className = end($use->name->parts);
40
-                            $builder->uses[ $className ] = 'use ' . implode('\\', $use->name->parts) . ';';
40
+                            $builder->uses[$className] = 'use ' . implode('\\', $use->name->parts) . ';';
41 41
                         }
42 42
                     }
43 43
                 }
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
                  */
49 49
                 $prettyPrinter = new PhpRender(['builder' => $builder, 'context' => $fileName]);
50 50
                 $newCode = $prettyPrinter->prettyPrintFile($ast);
51
-                $outputPathFile = $builder->getOutputPath(basename($fileName) . '.' .md5($newCode) . '.ast');
51
+                $outputPathFile = $builder->getOutputPath(basename($fileName) . '.' . md5($newCode) . '.ast');
52 52
                 file_put_contents($outputPathFile, $newCode);
53 53
                 $output = require $outputPathFile;
54 54
                 @unlink($outputPathFile);
Please login to merge, or discard this patch.
src/Builder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -247,6 +247,6 @@
 block discarded – undo
247 247
      */
248 248
     public static function require(string $config): callable
249 249
     {
250
-        return static fn () => require $config;
250
+        return static fn() => require $config;
251 251
     }
252 252
 }
Please login to merge, or discard this patch.
src/Util/PhpRender.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
     }
163 163
 
164 164
     protected function pScalar_LNumber(Scalar\LNumber $node) {
165
-        if ($node->value === -\PHP_INT_MAX-1) {
165
+        if ($node->value === -\PHP_INT_MAX - 1) {
166 166
             // PHP_INT_MIN cannot be represented as a literal,
167 167
             // because the sign is not part of the literal
168 168
             return '(-' . \PHP_INT_MAX . '-1)';
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
                     ? $this->p($node->name)
521 521
                     : '{' . $this->p($node->name) . '}')
522 522
                 : $node->name);
523
-        switch ($className){
523
+        switch ($className) {
524 524
             case 'Buildtime':
525 525
                 $token = $this->pMaybeMultiline($node->args);
526 526
                 break;
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
             . ($node->unpack ? '...' : '')
597 597
             . $this->p($node->value);
598 598
 
599
-        if(isset($node->value) && $node->value instanceof Expr\FuncCall){
599
+        if (isset($node->value) && $node->value instanceof Expr\FuncCall) {
600 600
             $token = '\'__' . md5($code) . '__\'';
601 601
             $this->options['builder']->closures[$token] = $code;
602 602
             $code = $token;
@@ -691,7 +691,7 @@  discard block
 block discarded – undo
691 691
         }
692 692
         $code = 'new ' . $this->pNewVariable($node->class)
693 693
             . '(' . $this->pMaybeMultiline($node->args) . ')';
694
-        if($this->pNewVariable($node->class) == 'ReverseBlockMerge'){
694
+        if ($this->pNewVariable($node->class) == 'ReverseBlockMerge') {
695 695
             return $code;
696 696
         }
697 697
         $token = '\'__' . md5($code) . '__\'';
@@ -782,7 +782,7 @@  discard block
 block discarded – undo
782 782
 
783 783
     protected function pStmt_TraitUse(Stmt\TraitUse $node) {
784 784
         $class = $this->pCommaSeparated($node->traits)
785
-            . (empty($node->adaptations)? ';': ' {' . $this->pStmts($node->adaptations) . $this->nl . '}');
785
+            . (empty($node->adaptations) ? ';' : ' {' . $this->pStmts($node->adaptations) . $this->nl . '}');
786 786
         return 'use ' . $class;
787 787
     }
788 788
 
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
         return (null !== $node->trait ? $this->p($node->trait) . '::' : '')
796 796
              . $node->method . ' as'
797 797
              . (null !== $node->newModifier ? ' ' . rtrim($this->pModifiers($node->newModifier), ' ') : '')
798
-             . (null !== $node->newName     ? ' ' . $node->newName                        : '')
798
+             . (null !== $node->newName ? ' ' . $node->newName : '')
799 799
              . ';';
800 800
     }
801 801
 
@@ -1028,7 +1028,7 @@  discard block
 block discarded – undo
1028 1028
         }
1029 1029
 
1030 1030
         // Escape other control characters
1031
-        return preg_replace_callback('/([\0-\10\16-\37])(?=([0-7]?))/', function ($matches) {
1031
+        return preg_replace_callback('/([\0-\10\16-\37])(?=([0-7]?))/', function($matches) {
1032 1032
             $oct = decoct(ord($matches[1]));
1033 1033
             if ($matches[2] !== '') {
1034 1034
                 // If there is a trailing digit, use the full three character form
@@ -1061,7 +1061,7 @@  discard block
 block discarded – undo
1061 1061
     protected function pDereferenceLhs(Node $node) {
1062 1062
         if (!$this->dereferenceLhsRequiresParens($node)) {
1063 1063
             return $this->p($node);
1064
-        } else  {
1064
+        } else {
1065 1065
             return '(' . $this->p($node) . ')';
1066 1066
         }
1067 1067
     }
@@ -1069,7 +1069,7 @@  discard block
 block discarded – undo
1069 1069
     protected function pCallLhs(Node $node) {
1070 1070
         if (!$this->callLhsRequiresParens($node)) {
1071 1071
             return $this->p($node);
1072
-        } else  {
1072
+        } else {
1073 1073
             return '(' . $this->p($node) . ')';
1074 1074
         }
1075 1075
     }
Please login to merge, or discard this patch.
src/Config/Envs.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 {
14 14
     protected function writeFile(string $path, array $data): void
15 15
     {
16
-        if($data) {
16
+        if ($data) {
17 17
             $envs = '[]'; //Helper::exportVar($data);
18 18
         } else {
19 19
             $envs = '[]';
Please login to merge, or discard this patch.
src/Config/Params.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
     public static function pushValues(array $data, array $values, string $prefix = null)
29 29
     {
30 30
         foreach ($data as $key => &$value) {
31
-            $subkey = $prefix===null ? $key : "${prefix}_$key";
31
+            $subkey = $prefix === null ? $key : "${prefix}_$key";
32 32
 
33 33
             $envkey = self::getEnvKey($subkey);
34 34
             if (isset($values[$envkey])) {
Please login to merge, or discard this patch.
src/Config/Config.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
         $constants = $this->constantsRequired() ? $this->builder->getConfig('constants')->buildRequires() : '';
144 144
         $params = $this->paramsRequired() ? "\$params = (array) require __DIR__ . '/params.php';" : '';
145 145
         $uses = '';
146
-        if($data) {
146
+        if ($data) {
147 147
             $variables = $this->buildPhpPartials($data);
148 148
             $uses = implode("\n", $this->builder->uses);
149 149
         } else {
@@ -181,18 +181,18 @@  discard block
 block discarded – undo
181 181
         foreach ($data as $key => $value) {
182 182
             if (is_array($value)) {
183 183
                 $output .= "'" . $key . "' => " . $this->buildPhpPartials($value) . ",\n";
184
-            } elseif(is_string($value)) {
185
-                if(isset($this->builder->closures["'{$value}'"])) {
184
+            } elseif (is_string($value)) {
185
+                if (isset($this->builder->closures["'{$value}'"])) {
186 186
                     $value = $this->builder->closures["'{$value}'"];
187 187
                 } else {
188 188
                     $value = "'{$value}'";
189 189
                 }
190 190
                 $output .= "'" . $key . "' => {$value},\n";
191 191
             } else {
192
-                if(is_bool($value)) {
193
-                    $value = $value? 'true': 'false';
192
+                if (is_bool($value)) {
193
+                    $value = $value ? 'true' : 'false';
194 194
                     $output .= "'" . $key . "' => {$value},\n";
195
-                } elseif(is_null($value)){
195
+                } elseif (is_null($value)) {
196 196
                     $output .= "'" . $key . "' => null,\n";
197 197
                 } else {
198 198
                     $output .= "'" . $key . "' => {$value},\n";
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
             }
201 201
         }
202 202
 
203
-        if($output) {
203
+        if ($output) {
204 204
             while (preg_match('~\'__(\w+)__\'~', $output, $m)) {
205 205
                 foreach ($this->builder->closures as $closureKey => $closure) {
206 206
                     if (strpos($output, $closureKey) !== false) {
Please login to merge, or discard this patch.