@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | public function boot() |
| 13 | 13 | { |
| 14 | 14 | $this->publishes([ |
| 15 | - __DIR__.'/../config/consolify.php' => config_path('consolify.php'), |
|
| 15 | + __DIR__ . '/../config/consolify.php' => config_path('consolify.php'), |
|
| 16 | 16 | ]); |
| 17 | 17 | } |
| 18 | 18 | |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | public function register() |
| 23 | 23 | { |
| 24 | - $this->mergeConfigFrom(__DIR__.'/../config/consolify.php', 'consolify'); |
|
| 24 | + $this->mergeConfigFrom(__DIR__ . '/../config/consolify.php', 'consolify'); |
|
| 25 | 25 | |
| 26 | 26 | // ... |
| 27 | 27 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | protected function handeException(Exception $e) |
| 83 | 83 | { |
| 84 | - $this->error(TraceReserved::FAILED." {$e->getMessage()}"); |
|
| 84 | + $this->error(TraceReserved::FAILED . " {$e->getMessage()}"); |
|
| 85 | 85 | |
| 86 | 86 | app()->log->error($e); |
| 87 | 87 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | */ |
| 99 | 99 | protected function getNotParsedArgument(InputInterface $input, $index) |
| 100 | 100 | { |
| 101 | - return explode(' ', (string) $input)[$index]; |
|
| 101 | + return explode(' ', (string)$input)[$index]; |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | /** |
@@ -110,6 +110,6 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | protected function isVerbose(InputInterface $input) |
| 112 | 112 | { |
| 113 | - return (bool) substr_count((string) $input, '-vvv'); |
|
| 113 | + return (bool)substr_count((string)$input, '-vvv'); |
|
| 114 | 114 | } |
| 115 | 115 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | public function get($from = null, $truncate = true) |
| 40 | 40 | { |
| 41 | - if (! $file = $this->getFile()) { |
|
| 41 | + if (!$file = $this->getFile()) { |
|
| 42 | 42 | throw new TraceException('Cannot find file to trace.'); |
| 43 | 43 | } |
| 44 | 44 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | protected function getFile() |
| 49 | 49 | { |
| 50 | - if (! file_exists($file = $this->uidToFile($this->uid))) { |
|
| 50 | + if (!file_exists($file = $this->uidToFile($this->uid))) { |
|
| 51 | 51 | return; |
| 52 | 52 | } |
| 53 | 53 | |
@@ -70,13 +70,13 @@ discard block |
||
| 70 | 70 | // If there is new content |
| 71 | 71 | if ($len > $last_position) { |
| 72 | 72 | $f = fopen($file, 'rb'); |
| 73 | - if (! $f) { |
|
| 73 | + if (!$f) { |
|
| 74 | 74 | throw new \LogicException("Cannot read file. [$file]"); |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | $lines = []; |
| 78 | 78 | fseek($f, $last_position); |
| 79 | - while (! feof($f)) { |
|
| 79 | + while (!feof($f)) { |
|
| 80 | 80 | $lines = array_merge( |
| 81 | 81 | $lines, |
| 82 | 82 | explode("\n", fread($f, 4096)) |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | public function addCommandLine($command) |
| 124 | 124 | { |
| 125 | - file_put_contents($this->getFile(), "[{$command}]".PHP_EOL, FILE_APPEND); |
|
| 125 | + file_put_contents($this->getFile(), "[{$command}]" . PHP_EOL, FILE_APPEND); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | /** |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | public function fileToUid($fullPath) |
| 158 | 158 | { |
| 159 | 159 | return $this->relativeFileToUid( |
| 160 | - str_replace($this->basePath.'/', '', $fullPath) |
|
| 160 | + str_replace($this->basePath . '/', '', $fullPath) |
|
| 161 | 161 | ); |
| 162 | 162 | } |
| 163 | 163 | |
@@ -82,9 +82,9 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | public function deletePersisted() |
| 84 | 84 | { |
| 85 | - $pattern = static::prefixedKey($this->uid).'*'; |
|
| 85 | + $pattern = static::prefixedKey($this->uid) . '*'; |
|
| 86 | 86 | |
| 87 | - if (! empty($keys = static::redis()->keys($pattern))) { |
|
| 87 | + if (!empty($keys = static::redis()->keys($pattern))) { |
|
| 88 | 88 | static::redis()->del(static::redis()->keys($pattern)); |
| 89 | 89 | } |
| 90 | 90 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | protected static function prefixedKey($key) |
| 103 | 103 | { |
| 104 | - return config('consolify.progress.redis_prefix').$key; |
|
| 104 | + return config('consolify.progress.redis_prefix') . $key; |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | protected function elapsed() |
@@ -111,11 +111,11 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | protected function estimated() |
| 113 | 113 | { |
| 114 | - if (! $this->bar->getMaxSteps()) { |
|
| 114 | + if (!$this->bar->getMaxSteps()) { |
|
| 115 | 115 | return; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | - return ! $this->bar->getProgress() |
|
| 118 | + return !$this->bar->getProgress() |
|
| 119 | 119 | ? 0 |
| 120 | 120 | : round((time() - $this->bar->getStartTime()) / $this->bar->getProgress() * $this->bar->getMaxSteps()); |
| 121 | 121 | } |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | { |
| 9 | 9 | public static function newProgressInstance($max, $uid, OutputInterface $output) |
| 10 | 10 | { |
| 11 | - if (! class_exists($progressClass = config('consolify.progress.concrete_class'))) { |
|
| 11 | + if (!class_exists($progressClass = config('consolify.progress.concrete_class'))) { |
|
| 12 | 12 | throw new \LogicException("Cannot find progress class [$progressClass]"); |
| 13 | 13 | } |
| 14 | 14 | |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | /** @return Progress */ |
| 26 | 26 | public static function progressFor($uid) |
| 27 | 27 | { |
| 28 | - if (! class_exists($progressClass = config('consolify.progress.concrete_class'))) { |
|
| 28 | + if (!class_exists($progressClass = config('consolify.progress.concrete_class'))) { |
|
| 29 | 29 | throw new \LogicException("Cannot find progress class [$progressClass]"); |
| 30 | 30 | } |
| 31 | 31 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | public function advanceProgress($step = 1) |
| 56 | 56 | { |
| 57 | - if (! $this->progress) { |
|
| 57 | + if (!$this->progress) { |
|
| 58 | 58 | throw new \Exception('No progress was created.'); |
| 59 | 59 | } |
| 60 | 60 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | public function info($string) |
| 80 | 80 | { |
| 81 | - if (! $this->output) { |
|
| 81 | + if (!$this->output) { |
|
| 82 | 82 | return; |
| 83 | 83 | } |
| 84 | 84 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | */ |
| 93 | 93 | public function line($string) |
| 94 | 94 | { |
| 95 | - if (! $this->output) { |
|
| 95 | + if (!$this->output) { |
|
| 96 | 96 | return; |
| 97 | 97 | } |
| 98 | 98 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | */ |
| 107 | 107 | public function comment($string) |
| 108 | 108 | { |
| 109 | - if (! $this->output) { |
|
| 109 | + if (!$this->output) { |
|
| 110 | 110 | return; |
| 111 | 111 | } |
| 112 | 112 | |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | */ |
| 121 | 121 | public function error($string) |
| 122 | 122 | { |
| 123 | - if (! $this->output) { |
|
| 123 | + if (!$this->output) { |
|
| 124 | 124 | return; |
| 125 | 125 | } |
| 126 | 126 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | public function done($string) |
| 136 | 136 | { |
| 137 | - if (! $this->output) { |
|
| 137 | + if (!$this->output) { |
|
| 138 | 138 | return; |
| 139 | 139 | } |
| 140 | 140 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | while ($remaining > $cycle) { |
| 183 | 183 | $remaining -= $cycle; |
| 184 | 184 | |
| 185 | - $this->setSleepModeStateInProgressBar($state = 'Remaining : '.$this->formatSeconds($remaining)); |
|
| 185 | + $this->setSleepModeStateInProgressBar($state = 'Remaining : ' . $this->formatSeconds($remaining)); |
|
| 186 | 186 | $this->line($state); |
| 187 | 187 | |
| 188 | 188 | sleep($cycle); |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | */ |
| 202 | 202 | protected function formatRemainingSeconds($seconds) |
| 203 | 203 | { |
| 204 | - return gmdate('i', $seconds).'m, '.gmdate('s', $seconds).'s'; |
|
| 204 | + return gmdate('i', $seconds) . 'm, ' . gmdate('s', $seconds) . 's'; |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | /** |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | /** @return Progress */ |
| 220 | 220 | protected function createProgressInstance($max, $uid) |
| 221 | 221 | { |
| 222 | - if (! class_exists($progressClass = config('consolify.progress.concrete_class'))) { |
|
| 222 | + if (!class_exists($progressClass = config('consolify.progress.concrete_class'))) { |
|
| 223 | 223 | throw new \LogicException("Cannot find progress class [$progressClass]"); |
| 224 | 224 | } |
| 225 | 225 | |