| 1 |
<?php |
| 2 |
|
| 3 |
declare (strict_types=1); |
| 4 |
/* |
| 5 |
* This file is part of the Monolog package. |
| 6 |
* |
| 7 |
* (c) Jordi Boggiano <[email protected]> |
| 8 |
* |
| 9 |
* For the full copyright and license information, please view the LICENSE |
| 10 |
* file that was distributed with this source code. |
| 11 |
*/ |
| 12 |
namespace Dudlewebs\WPMCS\Monolog\Handler; |
| 13 |
|
| 14 |
use Dudlewebs\WPMCS\Monolog\Processor\ProcessorInterface; |
| 15 |
/** |
| 16 |
* Interface to describe loggers that have processors |
| 17 |
* |
| 18 |
* @author Jordi Boggiano <[email protected]> |
| 19 |
* |
| 20 |
* @phpstan-import-type Record from \Monolog\Logger |
| 21 |
*/ |
| 22 |
interface ProcessableHandlerInterface |
| 23 |
{ |
| 24 |
/** |
| 25 |
* Adds a processor in the stack. |
| 26 |
* |
| 27 |
* @psalm-param ProcessorInterface|callable(Record): Record $callback |
| 28 |
* |
| 29 |
* @param ProcessorInterface|callable $callback |
| 30 |
* @return HandlerInterface self |
| 31 |
*/ |
| 32 |
public function pushProcessor(callable $callback): HandlerInterface; |
| 33 |
/** |
| 34 |
* Removes the processor on top of the stack and returns it. |
| 35 |
* |
| 36 |
* @psalm-return ProcessorInterface|callable(Record): Record $callback |
| 37 |
* |
| 38 |
* @throws \LogicException In case the processor stack is empty |
| 39 |
* @return callable|ProcessorInterface |
| 40 |
*/ |
| 41 |
public function popProcessor(): callable; |
| 42 |
} |
| 43 |
|