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