mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-01 19:00:20 +02:00
Fix naming conflicts in PhpConsoleHandler
This commit is contained in:
@@ -15,7 +15,7 @@ use Exception;
|
|||||||
use Monolog\Formatter\LineFormatter;
|
use Monolog\Formatter\LineFormatter;
|
||||||
use Monolog\Logger;
|
use Monolog\Logger;
|
||||||
use PhpConsole\Connector;
|
use PhpConsole\Connector;
|
||||||
use PhpConsole\Handler;
|
use PhpConsole\Handler as VendorPhpConsoleHandler;
|
||||||
use PhpConsole\Helper;
|
use PhpConsole\Helper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -107,7 +107,7 @@ class PHPConsoleHandler extends AbstractProcessingHandler
|
|||||||
|
|
||||||
if ($this->options['enabled'] && $connector->isActiveClient()) {
|
if ($this->options['enabled'] && $connector->isActiveClient()) {
|
||||||
if ($this->options['useOwnErrorsHandler'] || $this->options['useOwnExceptionsHandler']) {
|
if ($this->options['useOwnErrorsHandler'] || $this->options['useOwnExceptionsHandler']) {
|
||||||
$handler = Handler::getInstance();
|
$handler = VendorPhpConsoleHandler::getInstance();
|
||||||
$handler->setHandleErrors($this->options['useOwnErrorsHandler']);
|
$handler->setHandleErrors($this->options['useOwnErrorsHandler']);
|
||||||
$handler->setHandleExceptions($this->options['useOwnExceptionsHandler']);
|
$handler->setHandleExceptions($this->options['useOwnExceptionsHandler']);
|
||||||
$handler->start();
|
$handler->start();
|
||||||
|
@@ -18,7 +18,7 @@ use Monolog\TestCase;
|
|||||||
use PhpConsole\Connector;
|
use PhpConsole\Connector;
|
||||||
use PhpConsole\Dispatcher\Debug as DebugDispatcher;
|
use PhpConsole\Dispatcher\Debug as DebugDispatcher;
|
||||||
use PhpConsole\Dispatcher\Errors as ErrorDispatcher;
|
use PhpConsole\Dispatcher\Errors as ErrorDispatcher;
|
||||||
use PhpConsole\Handler;
|
use PhpConsole\Handler as VendorPhpConsoleHandler;
|
||||||
use PHPUnit_Framework_MockObject_MockObject;
|
use PHPUnit_Framework_MockObject_MockObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -214,9 +214,9 @@ class PHPConsoleHandlerTest extends TestCase
|
|||||||
public function testOptionUseOwnErrorsAndExceptionsHandler()
|
public function testOptionUseOwnErrorsAndExceptionsHandler()
|
||||||
{
|
{
|
||||||
$this->initLogger(array('useOwnErrorsHandler' => true, 'useOwnExceptionsHandler' => true));
|
$this->initLogger(array('useOwnErrorsHandler' => true, 'useOwnExceptionsHandler' => true));
|
||||||
$this->assertEquals(array(Handler::getInstance(), 'handleError'), set_error_handler(function () {
|
$this->assertEquals(array(VendorPhpConsoleHandler::getInstance(), 'handleError'), set_error_handler(function () {
|
||||||
}));
|
}));
|
||||||
$this->assertEquals(array(Handler::getInstance(), 'handleException'), set_exception_handler(function () {
|
$this->assertEquals(array(VendorPhpConsoleHandler::getInstance(), 'handleException'), set_exception_handler(function () {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user