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