@@ -108,7 +108,7 @@ |
||
| 108 | 108 | * |
| 109 | 109 | * @return $this |
| 110 | 110 | */ |
| 111 | - public function end(string $str = '', bool $force = false, $logLevel = LogLevels::INFO); |
|
| 111 | + public function end(string $str = '', bool $force = false, $logLevel = LogLevels::INFO); |
|
| 112 | 112 | |
| 113 | 113 | /** |
| 114 | 114 | * Log a message that ends a task with an HTTP status code. |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | // apply each of the formatters we've attached to this writer |
| 112 | - foreach($this->formatters as $formatter) { |
|
| 112 | + foreach ($this->formatters as $formatter) { |
|
| 113 | 113 | list($timestamp, $logLevel, $message, $indentLevel, $duration) = $formatter->format($timestamp, $logLevel, $indentLevel, $message, $duration); |
| 114 | 114 | } |
| 115 | 115 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $indentation = $indentLevel ? str_repeat(' ', $indentLevel).'- ' : ''; |
| 118 | 118 | |
| 119 | 119 | // build the log entry we'll write to the stream |
| 120 | - $logEntry = $timestamp . ' ' . $indentation . ' ' .$message; |
|
| 120 | + $logEntry = $timestamp.' '.$indentation.' '.$message; |
|
| 121 | 121 | if ($this->showDurations) { |
| 122 | 122 | $logEntry .= ' '.$duration; |
| 123 | 123 | } |
@@ -150,7 +150,7 @@ |
||
| 150 | 150 | $time = strftime($this->getDateFormat(), $time); |
| 151 | 151 | $message = $this->colorify($message, $logLevel); |
| 152 | 152 | |
| 153 | - if ($this->showDurations && ! is_null($duration)) { |
|
| 153 | + if ($this->showDurations && !is_null($duration)) { |
|
| 154 | 154 | $duration = $this->formatDuration($duration); |
| 155 | 155 | $duration = $this->colorify($duration, 'duration'); |
| 156 | 156 | } else { |
@@ -152,7 +152,7 @@ |
||
| 152 | 152 | foreach ($this->taskStack as $task) { |
| 153 | 153 | list($taskStr, $taskTimestamp, $taskIndentLevel) = $task; |
| 154 | 154 | if ($taskIndentLevel > $this->getMaxLevel()) { |
| 155 | - $this->write($taskTimestamp, LogLevels::INFO, $taskStr, $taskIndentLevel); |
|
| 155 | + $this->write($taskTimestamp, LogLevels::INFO, $taskStr, $taskIndentLevel); |
|
| 156 | 156 | } |
| 157 | 157 | } |
| 158 | 158 | } |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | * |
| 198 | 198 | * @return $this |
| 199 | 199 | */ |
| 200 | - public function end(string $str = '', bool $force = false, $logLevel = LogLevels::INFO) { |
|
| 200 | + public function end(string $str = '', bool $force = false, $logLevel = LogLevels::INFO) { |
|
| 201 | 201 | // get the task we are finishing (there has to be one) |
| 202 | 202 | $task = array_pop($this->taskStack); |
| 203 | 203 | if (is_null($task)) { |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | * @return $this |
| 256 | 256 | */ |
| 257 | 257 | public function write(int $timestamp, string $logLevel, string $message, $indentLevel = 0, $duration = null) { |
| 258 | - foreach($this->writers as $writer) { |
|
| 258 | + foreach ($this->writers as $writer) { |
|
| 259 | 259 | $writer->write($timestamp, $logLevel, $message, $indentLevel, $duration); |
| 260 | 260 | } |
| 261 | 261 | |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | * The Garden logger has its own version of log levels different from RFC 5424 and RFC 3164. |
| 14 | 14 | */ |
| 15 | 15 | class LogLevels { |
| 16 | - const INFO = 'info'; // is also the "default" level |
|
| 16 | + const INFO = 'info'; // is also the "default" level |
|
| 17 | 17 | const SUCCESS = 'success'; |
| 18 | 18 | const ERROR = 'error'; |
| 19 | 19 | const WARNING = 'warning'; |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $this->commandSchemas = ['*' => [Cli::META => []]]; |
| 52 | 52 | |
| 53 | 53 | // Select the current schema. |
| 54 | - $this->currentSchema =& $this->commandSchemas['*']; |
|
| 54 | + $this->currentSchema = & $this->commandSchemas['*']; |
|
| 55 | 55 | |
| 56 | 56 | $this->formatOutput = static::guessFormatOutput(); |
| 57 | 57 | } |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | } |
| 383 | 383 | |
| 384 | 384 | if (!is_array($argv)) { |
| 385 | - throw new \Exception(__METHOD__ . " expects an array", 400); |
|
| 385 | + throw new \Exception(__METHOD__." expects an array", 400); |
|
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | $path = array_shift($argv); |
@@ -757,7 +757,7 @@ discard block |
||
| 757 | 757 | if (!isset($this->commandSchemas[$pattern])) { |
| 758 | 758 | $this->commandSchemas[$pattern] = [Cli::META => []]; |
| 759 | 759 | } |
| 760 | - $this->currentSchema =& $this->commandSchemas[$pattern]; |
|
| 760 | + $this->currentSchema = & $this->commandSchemas[$pattern]; |
|
| 761 | 761 | |
| 762 | 762 | return $this; |
| 763 | 763 | } |
@@ -986,14 +986,14 @@ discard block |
||
| 986 | 986 | break; |
| 987 | 987 | case 'integer': |
| 988 | 988 | if (is_numeric($value)) { |
| 989 | - $value = (int)$value; |
|
| 989 | + $value = (int) $value; |
|
| 990 | 990 | $valid = true; |
| 991 | 991 | } else { |
| 992 | 992 | $valid = false; |
| 993 | 993 | } |
| 994 | 994 | break; |
| 995 | 995 | case 'string': |
| 996 | - $value = (string)$value; |
|
| 996 | + $value = (string) $value; |
|
| 997 | 997 | $valid = true; |
| 998 | 998 | break; |
| 999 | 999 | default: |
@@ -1001,7 +1001,7 @@ discard block |
||
| 1001 | 1001 | } |
| 1002 | 1002 | |
| 1003 | 1003 | if (!$valid && $name) { |
| 1004 | - $short = static::val('short', (array)$def); |
|
| 1004 | + $short = static::val('short', (array) $def); |
|
| 1005 | 1005 | $nameStr = "--$name".($short ? " (-$short)" : ''); |
| 1006 | 1006 | echo $this->red("The value of $nameStr is not a valid $type.".PHP_EOL); |
| 1007 | 1007 | } |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | */ |
| 196 | 196 | public function row() { |
| 197 | 197 | $this->rows[] = []; |
| 198 | - $this->currentRow =& $this->rows[count($this->rows) - 1]; |
|
| 198 | + $this->currentRow = & $this->rows[count($this->rows) - 1]; |
|
| 199 | 199 | return $this; |
| 200 | 200 | } |
| 201 | 201 | |
@@ -233,11 +233,11 @@ discard block |
||
| 233 | 233 | |
| 234 | 234 | if (isset($lines[$i])) { |
| 235 | 235 | if ($this->formatOutput) { |
| 236 | - if(isset($row[$j])) { |
|
| 236 | + if (isset($row[$j])) { |
|
| 237 | 237 | $wrap = $row[$j][1]; |
| 238 | 238 | } else { |
| 239 | 239 | // if we're out of array, use the latest wraps |
| 240 | - $wrap = $row[count($row)-1][1]; |
|
| 240 | + $wrap = $row[count($row) - 1][1]; |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | echo str_repeat(' ', $padding).$wrap[0].$lines[$i].$wrap[1]; |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | // apply each of the formatters we've attached to this writer |
| 115 | - foreach($this->formatters as $formatter) { |
|
| 115 | + foreach ($this->formatters as $formatter) { |
|
| 116 | 116 | list($timestamp, $logLevel, $indentLevel, $message, $duration) = $formatter->format($timestamp, $logLevel, $indentLevel, $message, $duration); |
| 117 | 117 | } |
| 118 | 118 | |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $indentation = $indentLevel ? str_repeat(' ', $indentLevel).'- ' : ''; |
| 121 | 121 | |
| 122 | 122 | // build the log entry we'll write to the file |
| 123 | - $logEntry = $timestamp . ' ' . strtoupper($logLevel) . ' ' . $indentation . ' ' .$message; |
|
| 123 | + $logEntry = $timestamp.' '.strtoupper($logLevel).' '.$indentation.' '.$message; |
|
| 124 | 124 | if ($this->showDurations) { |
| 125 | 125 | $logEntry .= ' '.$duration; |
| 126 | 126 | } |