| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 43 | 2 | public function update(SubjectInterface $subject, $arguments = null) |
|
| 44 | { |
||
| 45 | // Check instance |
||
| 46 | 2 | if (!$arguments instanceof LogRecord) { |
|
| 47 | 1 | return; |
|
| 48 | } |
||
| 49 | |||
| 50 | // Create file |
||
| 51 | 1 | $file = new File($this->path . DIRECTORY_SEPARATOR . strtolower($arguments->getLevel()) . static::DEFAULT_EXTENSION); |
|
| 52 | |||
| 53 | // Append message |
||
| 54 | 1 | $file->append((new \DateTime())->format('Y-m-d H:i:s') . ' - ' . $arguments->getMessage() . PHP_EOL); |
|
| 55 | 1 | } |
|
| 56 | } |
||
| 57 |