@@ -12,8 +12,7 @@ discard block |
||
12 | 12 | * @package Yep\WorkflowLogger |
13 | 13 | * @author Martin Zeman (Zemistr) <[email protected]> |
14 | 14 | */ |
15 | -class Workflow implements PsrLoggerInterface |
|
16 | -{ |
|
15 | +class Workflow implements PsrLoggerInterface { |
|
17 | 16 | const EMERGENCY = 'emergency'; |
18 | 17 | const ALERT = 'alert'; |
19 | 18 | const CRITICAL = 'critical'; |
@@ -95,8 +94,7 @@ discard block |
||
95 | 94 | /** |
96 | 95 | * @return \DateTime |
97 | 96 | */ |
98 | - protected function getCurrentDateTime() |
|
99 | - { |
|
97 | + protected function getCurrentDateTime() { |
|
100 | 98 | $time = new \DateTime(null, $this->timezone); |
101 | 99 | $time->setTimezone($this->timezone); |
102 | 100 | |
@@ -106,16 +104,14 @@ discard block |
||
106 | 104 | /** |
107 | 105 | * @return string |
108 | 106 | */ |
109 | - public function getName() |
|
110 | - { |
|
107 | + public function getName() { |
|
111 | 108 | return $this->name; |
112 | 109 | } |
113 | 110 | |
114 | 111 | /** |
115 | 112 | * @return int|string |
116 | 113 | */ |
117 | - public function getLevel() |
|
118 | - { |
|
114 | + public function getLevel() { |
|
119 | 115 | return $this->level; |
120 | 116 | } |
121 | 117 | |
@@ -126,8 +122,7 @@ discard block |
||
126 | 122 | * @return string |
127 | 123 | * @throws LevelIsNotDefinedException |
128 | 124 | */ |
129 | - public function getLevelName($level) |
|
130 | - { |
|
125 | + public function getLevelName($level) { |
|
131 | 126 | if (!isset(static::$levels[$level])) { |
132 | 127 | throw LevelIsNotDefinedException::create($level, static::$levels); |
133 | 128 | } |
@@ -142,8 +137,7 @@ discard block |
||
142 | 137 | * @param array $context The log context |
143 | 138 | * @return void |
144 | 139 | */ |
145 | - public function finish($message = '', array $context = []) |
|
146 | - { |
|
140 | + public function finish($message = '', array $context = []) { |
|
147 | 141 | $message .= $message === '' ? '' : "\n\n"; |
148 | 142 | $message .= "Workflow: {$this->getName()}\n"; |
149 | 143 | |
@@ -163,8 +157,7 @@ discard block |
||
163 | 157 | * @return void |
164 | 158 | * @throws \Yep\WorkflowLogger\Exception\LevelIsNotDefinedException |
165 | 159 | */ |
166 | - public function log($level, $message, array $context = []) |
|
167 | - { |
|
160 | + public function log($level, $message, array $context = []) { |
|
168 | 161 | $this->records[] = new Record( |
169 | 162 | $this->getCurrentDateTime(), |
170 | 163 | $message, |
@@ -181,8 +174,7 @@ discard block |
||
181 | 174 | * @return void |
182 | 175 | * @throws \Yep\WorkflowLogger\Exception\LevelIsNotDefinedException |
183 | 176 | */ |
184 | - public function emergency($message, array $context = []) |
|
185 | - { |
|
177 | + public function emergency($message, array $context = []) { |
|
186 | 178 | $this->log(self::EMERGENCY, $message, $context); |
187 | 179 | } |
188 | 180 | |
@@ -197,8 +189,7 @@ discard block |
||
197 | 189 | * @return void |
198 | 190 | * @throws \Yep\WorkflowLogger\Exception\LevelIsNotDefinedException |
199 | 191 | */ |
200 | - public function alert($message, array $context = []) |
|
201 | - { |
|
192 | + public function alert($message, array $context = []) { |
|
202 | 193 | $this->log(self::ALERT, $message, $context); |
203 | 194 | } |
204 | 195 | |
@@ -212,8 +203,7 @@ discard block |
||
212 | 203 | * @return void |
213 | 204 | * @throws \Yep\WorkflowLogger\Exception\LevelIsNotDefinedException |
214 | 205 | */ |
215 | - public function critical($message, array $context = []) |
|
216 | - { |
|
206 | + public function critical($message, array $context = []) { |
|
217 | 207 | $this->log(self::CRITICAL, $message, $context); |
218 | 208 | } |
219 | 209 | |
@@ -226,8 +216,7 @@ discard block |
||
226 | 216 | * @return void |
227 | 217 | * @throws \Yep\WorkflowLogger\Exception\LevelIsNotDefinedException |
228 | 218 | */ |
229 | - public function error($message, array $context = []) |
|
230 | - { |
|
219 | + public function error($message, array $context = []) { |
|
231 | 220 | $this->log(self::ERROR, $message, $context); |
232 | 221 | } |
233 | 222 | |
@@ -242,8 +231,7 @@ discard block |
||
242 | 231 | * @return void |
243 | 232 | * @throws \Yep\WorkflowLogger\Exception\LevelIsNotDefinedException |
244 | 233 | */ |
245 | - public function warning($message, array $context = []) |
|
246 | - { |
|
234 | + public function warning($message, array $context = []) { |
|
247 | 235 | $this->log(self::WARNING, $message, $context); |
248 | 236 | } |
249 | 237 | |
@@ -255,8 +243,7 @@ discard block |
||
255 | 243 | * @return void |
256 | 244 | * @throws \Yep\WorkflowLogger\Exception\LevelIsNotDefinedException |
257 | 245 | */ |
258 | - public function notice($message, array $context = []) |
|
259 | - { |
|
246 | + public function notice($message, array $context = []) { |
|
260 | 247 | $this->log(self::NOTICE, $message, $context); |
261 | 248 | } |
262 | 249 | |
@@ -270,8 +257,7 @@ discard block |
||
270 | 257 | * @return void |
271 | 258 | * @throws \Yep\WorkflowLogger\Exception\LevelIsNotDefinedException |
272 | 259 | */ |
273 | - public function info($message, array $context = []) |
|
274 | - { |
|
260 | + public function info($message, array $context = []) { |
|
275 | 261 | $this->log(self::INFO, $message, $context); |
276 | 262 | } |
277 | 263 | |
@@ -283,8 +269,7 @@ discard block |
||
283 | 269 | * @return void |
284 | 270 | * @throws \Yep\WorkflowLogger\Exception\LevelIsNotDefinedException |
285 | 271 | */ |
286 | - public function debug($message, array $context = []) |
|
287 | - { |
|
272 | + public function debug($message, array $context = []) { |
|
288 | 273 | $this->log(self::DEBUG, $message, $context); |
289 | 274 | } |
290 | 275 | } |