@@ -30,7 +30,7 @@ |
||
30 | 30 | |
31 | 31 | if ($context !== null) { |
32 | 32 | foreach ($context as $key => $val) { |
33 | - $replace['{' . $key . '}'] = $val; |
|
33 | + $replace['{'.$key.'}'] = $val; |
|
34 | 34 | } |
35 | 35 | } |
36 | 36 |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function __construct($path) |
32 | 32 | { |
33 | - $this->path = $this->fixDirectorySeparator($path); |
|
33 | + $this->path = $this->fixDirectorySeparator($path); |
|
34 | 34 | if ($this->exists()) { |
35 | 35 | $this->path = realpath($this->path); |
36 | 36 | } |
@@ -199,9 +199,9 @@ discard block |
||
199 | 199 | */ |
200 | 200 | private function fixDirectorySeparator($path) |
201 | 201 | { |
202 | - $path = str_replace("\\", DIRECTORY_SEPARATOR , $path); |
|
203 | - $path = str_replace("/", DIRECTORY_SEPARATOR, $path); |
|
202 | + $path = str_replace("\\", DIRECTORY_SEPARATOR , $path); |
|
203 | + $path = str_replace("/", DIRECTORY_SEPARATOR, $path); |
|
204 | 204 | |
205 | - return $path; |
|
205 | + return $path; |
|
206 | 206 | } |
207 | 207 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function isEmpty($filter = null) |
50 | 50 | { |
51 | - if (! $this->exists()) { |
|
51 | + if (!$this->exists()) { |
|
52 | 52 | throw new DirectoryException("Directory {dir} does not exist", array( |
53 | 53 | 'dir' => $this->path |
54 | 54 | )); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | $iter = new \DirectoryIterator($this->path); |
58 | 58 | while ($iter->valid()) { |
59 | - if (! $iter->isDot() && ($filter === null || ! preg_match("/$filter/", $iter->getFilename()))) { |
|
59 | + if (!$iter->isDot() && ($filter === null || !preg_match("/$filter/", $iter->getFilename()))) { |
|
60 | 60 | return false; |
61 | 61 | } |
62 | 62 | $iter->next(); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public function remove($recursive = false) |
77 | 77 | { |
78 | - if (! $this->exists()) { |
|
78 | + if (!$this->exists()) { |
|
79 | 79 | return; |
80 | 80 | } |
81 | 81 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | return; |
89 | 89 | } |
90 | 90 | |
91 | - if (! $recursive) { |
|
91 | + if (!$recursive) { |
|
92 | 92 | throw new DirectoryException("Directory {dir} is not empty", array( |
93 | 93 | 'dir' => $this->path |
94 | 94 | )); |
@@ -145,11 +145,11 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public function exists() |
147 | 147 | { |
148 | - if (! file_exists($this->path)) { |
|
148 | + if (!file_exists($this->path)) { |
|
149 | 149 | return false; |
150 | 150 | } |
151 | 151 | |
152 | - if (! is_dir($this->path)) { |
|
152 | + if (!is_dir($this->path)) { |
|
153 | 153 | throw new DirectoryException("Entry {path} exists, but it is not a directory!", array( |
154 | 154 | 'path' => $this->path |
155 | 155 | )); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | */ |
181 | 181 | public function fileExists($fileName) |
182 | 182 | { |
183 | - if (! $this->exists()) { |
|
183 | + if (!$this->exists()) { |
|
184 | 184 | return false; |
185 | 185 | } |
186 | 186 | |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | */ |
200 | 200 | private function fixDirectorySeparator($path) |
201 | 201 | { |
202 | - $path = str_replace("\\", DIRECTORY_SEPARATOR , $path); |
|
202 | + $path = str_replace("\\", DIRECTORY_SEPARATOR, $path); |
|
203 | 203 | $path = str_replace("/", DIRECTORY_SEPARATOR, $path); |
204 | 204 | |
205 | 205 | return $path; |
@@ -14,7 +14,7 @@ |
||
14 | 14 | */ |
15 | 15 | trait DumpLoggerTrait |
16 | 16 | { |
17 | - abstract public function debug($message, array $context = array()); |
|
17 | + abstract public function debug($message, array $context = array()); |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * {@inheritDoc} |
@@ -16,7 +16,7 @@ |
||
16 | 16 | */ |
17 | 17 | trait ExceptionLoggerTrait |
18 | 18 | { |
19 | - abstract protected function logImpl($level, $message, array $context = array()); |
|
19 | + abstract protected function logImpl($level, $message, array $context = array()); |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * {@inheritDoc} |
@@ -16,6 +16,9 @@ |
||
16 | 16 | */ |
17 | 17 | trait ExceptionLoggerTrait |
18 | 18 | { |
19 | + /** |
|
20 | + * @param string $message |
|
21 | + */ |
|
19 | 22 | abstract protected function logImpl($level, $message, array $context = array()); |
20 | 23 | |
21 | 24 | /** |
@@ -472,6 +472,6 @@ |
||
472 | 472 | */ |
473 | 473 | public function isOpen() |
474 | 474 | { |
475 | - return true; |
|
475 | + return true; |
|
476 | 476 | } |
477 | 477 | } |
@@ -49,6 +49,6 @@ |
||
49 | 49 | */ |
50 | 50 | public function __construct($message, array $context = array(), $code = 0, Exception $previous = null) |
51 | 51 | { |
52 | - parent::__construct($message, $context, $code, $previous); |
|
52 | + parent::__construct($message, $context, $code, $previous); |
|
53 | 53 | } |
54 | 54 | } |
@@ -8,24 +8,24 @@ discard block |
||
8 | 8 | |
9 | 9 | abstract class BasicLogger extends AbstractLogger |
10 | 10 | { |
11 | - /** |
|
12 | - * The level threshold where to log |
|
13 | - * |
|
14 | - * @var string |
|
15 | - */ |
|
16 | - private $level; |
|
11 | + /** |
|
12 | + * The level threshold where to log |
|
13 | + * |
|
14 | + * @var string |
|
15 | + */ |
|
16 | + private $level; |
|
17 | 17 | |
18 | - /** |
|
19 | - * Set the log level threshold |
|
20 | - * |
|
21 | - * @param string $level |
|
22 | - * @return BasicLogger |
|
23 | - */ |
|
24 | - public function setLevel(string $level):BasicLogger |
|
25 | - { |
|
26 | - $this->level = $level; |
|
27 | - return $this; |
|
28 | - } |
|
18 | + /** |
|
19 | + * Set the log level threshold |
|
20 | + * |
|
21 | + * @param string $level |
|
22 | + * @return BasicLogger |
|
23 | + */ |
|
24 | + public function setLevel(string $level):BasicLogger |
|
25 | + { |
|
26 | + $this->level = $level; |
|
27 | + return $this; |
|
28 | + } |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Checks the given level |
@@ -89,32 +89,32 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function log($level, $message, array $context = array()) |
91 | 91 | { |
92 | - if( $this->levelHasReached($level) ) { |
|
93 | - $this->logImpl($level, $message, $context); |
|
94 | - } |
|
92 | + if( $this->levelHasReached($level) ) { |
|
93 | + $this->logImpl($level, $message, $context); |
|
94 | + } |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | protected function levelHasReached($level):bool |
98 | 98 | { |
99 | - $result = true; |
|
99 | + $result = true; |
|
100 | 100 | |
101 | - $orderedLevels = array( |
|
102 | - LogLevel::EMERGENCY => 0, |
|
103 | - LogLevel::ALERT => 1, |
|
104 | - LogLevel::CRITICAL => 2, |
|
105 | - LogLevel::ERROR => 3, |
|
106 | - LogLevel::WARNING => 4, |
|
107 | - LogLevel::NOTICE => 5, |
|
108 | - LogLevel::INFO => 6, |
|
109 | - LogLevel::DEBUG => 7 |
|
110 | - ); |
|
101 | + $orderedLevels = array( |
|
102 | + LogLevel::EMERGENCY => 0, |
|
103 | + LogLevel::ALERT => 1, |
|
104 | + LogLevel::CRITICAL => 2, |
|
105 | + LogLevel::ERROR => 3, |
|
106 | + LogLevel::WARNING => 4, |
|
107 | + LogLevel::NOTICE => 5, |
|
108 | + LogLevel::INFO => 6, |
|
109 | + LogLevel::DEBUG => 7 |
|
110 | + ); |
|
111 | 111 | |
112 | - if ( $this->level ) { |
|
113 | - $threshold = $orderedLevels[$this->level]; |
|
114 | - $reached = $orderedLevels[$level]; |
|
115 | - $result = $reached <= $threshold; |
|
116 | - } |
|
112 | + if ( $this->level ) { |
|
113 | + $threshold = $orderedLevels[$this->level]; |
|
114 | + $reached = $orderedLevels[$level]; |
|
115 | + $result = $reached <= $threshold; |
|
116 | + } |
|
117 | 117 | |
118 | - return $result; |
|
118 | + return $result; |
|
119 | 119 | } |
120 | 120 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function log($level, $message, array $context = array()) |
91 | 91 | { |
92 | - if( $this->levelHasReached($level) ) { |
|
92 | + if ($this->levelHasReached($level)) { |
|
93 | 93 | $this->logImpl($level, $message, $context); |
94 | 94 | } |
95 | 95 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | LogLevel::DEBUG => 7 |
110 | 110 | ); |
111 | 111 | |
112 | - if ( $this->level ) { |
|
112 | + if ($this->level) { |
|
113 | 113 | $threshold = $orderedLevels[$this->level]; |
114 | 114 | $reached = $orderedLevels[$level]; |
115 | 115 | $result = $reached <= $threshold; |