| 1 | <?php |
||
| 25 | abstract class HandlerAbstract implements HandlerInterface, FormatterAwareInterface |
||
| 26 | { |
||
| 27 | use FormatterAwareTrait; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @param FormatterInterface $formatter |
||
| 31 | */ |
||
| 32 | public function __construct(FormatterInterface $formatter = null) |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Destructor |
||
| 39 | * |
||
| 40 | * @access public |
||
| 41 | */ |
||
| 42 | public function __destruct() |
||
| 46 | |||
| 47 | /** |
||
| 48 | * {@inheritDoc} |
||
| 49 | */ |
||
| 50 | public function handle(LogEntryInterface $entry): LogEntryInterface |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Is this handler handling this log ? |
||
| 60 | * |
||
| 61 | * @return bool |
||
| 62 | */ |
||
| 63 | protected function isHandling(): bool |
||
| 67 | |||
| 68 | /** |
||
| 69 | * Close the handler |
||
| 70 | */ |
||
| 71 | protected function close() |
||
| 74 | |||
| 75 | /** |
||
| 76 | * Write to handler's device |
||
| 77 | * |
||
| 78 | * @param LogEntryInterface $entry |
||
| 79 | */ |
||
| 80 | abstract protected function write(LogEntryInterface $entry); |
||
| 81 | } |
||
| 82 |