@@ -1,8 +1,6 @@ |
||
1 | 1 | <?php namespace jlourenco\support\Commands; |
2 | 2 | |
3 | 3 | use Illuminate\Console\Command; |
4 | -use Symfony\Component\Console\Input\InputOption; |
|
5 | -use Symfony\Component\Console\Input\InputArgument; |
|
6 | 4 | use File; |
7 | 5 | |
8 | 6 | class SetupCommand extends Command { |
@@ -55,7 +55,7 @@ |
||
55 | 55 | $mainFile = $path . '/jlourenco.php'; |
56 | 56 | $fileExists = file_exists($mainFile); |
57 | 57 | |
58 | - $files = array_filter(scandir($path), function ($var) { |
|
58 | + $files = array_filter(scandir($path), function($var) { |
|
59 | 59 | return (!(stripos($var, 'jlourenco.') === false) && $var != 'jlourenco.php'); |
60 | 60 | }); |
61 | 61 |
@@ -59,8 +59,9 @@ discard block |
||
59 | 59 | return (!(stripos($var, 'jlourenco.') === false) && $var != 'jlourenco.php'); |
60 | 60 | }); |
61 | 61 | |
62 | - if ($fileExists) |
|
63 | - unlink($mainFile); |
|
62 | + if ($fileExists) { |
|
63 | + unlink($mainFile); |
|
64 | + } |
|
64 | 65 | |
65 | 66 | touch($mainFile); |
66 | 67 | |
@@ -73,8 +74,9 @@ discard block |
||
73 | 74 | |
74 | 75 | while ($line = fgets($in)) |
75 | 76 | { |
76 | - if ((stripos($line, '<?php') === false) && (stripos($line, '];') === false) && (stripos($line, 'return [') === false)) |
|
77 | - $content .= $line; |
|
77 | + if ((stripos($line, '<?php') === false) && (stripos($line, '];') === false) && (stripos($line, 'return [') === false)) { |
|
78 | + $content .= $line; |
|
79 | + } |
|
78 | 80 | } |
79 | 81 | |
80 | 82 | fclose($in); |
@@ -85,8 +87,9 @@ discard block |
||
85 | 87 | $content .= "];\n"; |
86 | 88 | |
87 | 89 | $bytesWritten = File::append($mainFile, $content); |
88 | - if ($bytesWritten === false) |
|
89 | - die("Couldn't write to config file."); |
|
90 | + if ($bytesWritten === false) { |
|
91 | + die("Couldn't write to config file."); |
|
92 | + } |
|
90 | 93 | |
91 | 94 | $this->info('Config files compiled'); |
92 | 95 | } |