| Total Complexity | 6 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class Logger extends Output |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * Log of received messages. |
||
| 9 | * |
||
| 10 | * @var array |
||
| 11 | */ |
||
| 12 | protected $log = []; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Write a message. |
||
| 16 | * |
||
| 17 | * @param string $message |
||
| 18 | */ |
||
| 19 | public function write($message) |
||
| 23 | } |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Return the log array. |
||
| 28 | * |
||
| 29 | * @param int $index |
||
| 30 | * |
||
| 31 | * @return array |
||
| 32 | */ |
||
| 33 | public function getLog($index = null) |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Return true if log contains message. |
||
| 44 | * |
||
| 45 | * @param string $message |
||
| 46 | * |
||
| 47 | * @return bool |
||
| 48 | */ |
||
| 49 | public function hasMessage($message) |
||
| 50 | { |
||
| 51 | return in_array($message, $this->getLog()); |
||
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * Clear the log. |
||
| 56 | */ |
||
| 57 | public function clearLog() |
||
| 60 | } |
||
| 61 | } |
||
| 62 |