@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use allejo\stakx\Core\ConsoleInterface; |
| 6 | 6 | use allejo\stakx\System\Filesystem; |
| 7 | 7 | use allejo\stakx\Utilities\ArrayUtilities; |
| 8 | -use Symfony\Component\Console\Output\OutputInterface; |
|
| 9 | 8 | use Symfony\Component\Yaml\Exception\ParseException; |
| 10 | 9 | use Symfony\Component\Yaml\Yaml; |
| 11 | 10 | |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | /** |
| 29 | 29 | * {@inheritdoc} |
| 30 | 30 | */ |
| 31 | - public function setLogger(LoggerInterface $logger) |
|
| 31 | + public function setLogger (LoggerInterface $logger) |
|
| 32 | 32 | { |
| 33 | 33 | $this->output = $logger; |
| 34 | 34 | } |
@@ -40,6 +40,9 @@ |
||
| 40 | 40 | $this->fs = new Filesystem(); |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | + /** |
|
| 44 | + * @param string $configFile |
|
| 45 | + */ |
|
| 43 | 46 | public function parseConfiguration ($configFile) |
| 44 | 47 | { |
| 45 | 48 | if ($this->fs->exists($configFile)) |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | /** |
| 35 | 35 | * Configuration constructor. |
| 36 | 36 | */ |
| 37 | - public function __construct() |
|
| 37 | + public function __construct () |
|
| 38 | 38 | { |
| 39 | 39 | $this->configuration = array(); |
| 40 | 40 | $this->fs = new Filesystem(); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | /** |
| 65 | 65 | * {@inheritdoc} |
| 66 | 66 | */ |
| 67 | - public function setLogger(LoggerInterface $logger) |
|
| 67 | + public function setLogger (LoggerInterface $logger) |
|
| 68 | 68 | { |
| 69 | 69 | $this->output = $logger; |
| 70 | 70 | } |
@@ -140,7 +140,7 @@ |
||
| 140 | 140 | * |
| 141 | 141 | * @return string |
| 142 | 142 | */ |
| 143 | - private function interpolate($message, array $context) |
|
| 143 | + private function interpolate ($message, array $context) |
|
| 144 | 144 | { |
| 145 | 145 | // build a replacement array with braces around the context keys |
| 146 | 146 | $replace = array(); |
@@ -93,7 +93,8 @@ discard block |
||
| 93 | 93 | */ |
| 94 | 94 | public function log ($level, $message, array $context = array()) |
| 95 | 95 | { |
| 96 | - if (!isset($this->verbosityLevelMap[$level])) { |
|
| 96 | + if (!isset($this->verbosityLevelMap[$level])) |
|
| 97 | + { |
|
| 97 | 98 | throw new InvalidArgumentException(sprintf('The log level "%s" does not exist.', $level)); |
| 98 | 99 | } |
| 99 | 100 | |
@@ -144,8 +145,10 @@ discard block |
||
| 144 | 145 | { |
| 145 | 146 | // build a replacement array with braces around the context keys |
| 146 | 147 | $replace = array(); |
| 147 | - foreach ($context as $key => $val) { |
|
| 148 | - if (!is_array($val) && (!is_object($val) || method_exists($val, '__toString'))) { |
|
| 148 | + foreach ($context as $key => $val) |
|
| 149 | + { |
|
| 150 | + if (!is_array($val) && (!is_object($val) || method_exists($val, '__toString'))) |
|
| 151 | + { |
|
| 149 | 152 | $replace[sprintf('{%s}', $key)] = $val; |
| 150 | 153 | } |
| 151 | 154 | } |