1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-24 10:06:08 +02:00

Added some methods in the HandlerInterface and some typehints

This commit is contained in:
Christophe Coevoet
2011-03-19 23:07:44 +01:00
parent fb503eebf2
commit 3a3c96d6d7
6 changed files with 56 additions and 14 deletions

View File

@@ -11,6 +11,8 @@
namespace Monolog\Handler;
use Monolog\Formatter\FormatterInterface;
/**
* Interface that all Monolog Handlers must implement
*
@@ -18,7 +20,46 @@ namespace Monolog\Handler;
*/
interface HandlerInterface
{
public function isHandling($record);
/**
* Checks whether the handler handles the record.
*
* @return Boolean
*/
public function isHandling(array $record);
public function handle($record);
/**
* Handles a record.
*
* @param array $record The record to handle
* @return Boolean Whether the handler stops the propagation in the stack or not.
*/
public function handle(array $record);
/**
* Adds a processor in the stack.
*
* @param callable $callback
*/
function pushProcessor($callback);
/**
* Removes the processor on top of the stack and returns it.
*
* @return callable
*/
function popProcessor();
/**
* Sets the formatter.
*
* @param FormatterInterface $formatter
*/
function setFormatter(FormatterInterface $formatter);
/**
* Gets the formatter.
*
* @return FormatterInterface
*/
function getFormatter();
}