renamed the ErrorHandler component to ErrorCatcher

This commit is contained in:
Fabien Potencier 2019-06-27 18:12:00 +02:00
parent 4d8c473fd3
commit b6eac3f861
104 changed files with 277 additions and 279 deletions

View File

@ -49,6 +49,7 @@
"symfony/dom-crawler": "self.version",
"symfony/dotenv": "self.version",
"symfony/event-dispatcher": "self.version",
"symfony/error-catcher": "self.version",
"symfony/expression-language": "self.version",
"symfony/filesystem": "self.version",
"symfony/finder": "self.version",

View File

@ -20,7 +20,7 @@ use Symfony\Component\Console\Output\ConsoleOutputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\ErrorHandler\Exception\FatalThrowableError;
use Symfony\Component\ErrorCatcher\Exception\FatalThrowableError;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\HttpKernel\KernelInterface;

View File

@ -152,7 +152,7 @@ class FrameworkExtension extends Extension
$loader->load('web.xml');
$loader->load('services.xml');
$loader->load('fragment_renderer.xml');
$loader->load('error_renderer.xml');
$loader->load('error_catcher.xml');
$container->registerAliasForArgument('parameter_bag', PsrContainerInterface::class);

View File

@ -32,8 +32,8 @@ use Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\Compiler\RegisterReverseContainerPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\ErrorHandler\DependencyInjection\ErrorHandlerPass;
use Symfony\Component\ErrorHandler\ErrorHandler;
use Symfony\Component\ErrorCatcher\DependencyInjection\ErrorCatcherPass;
use Symfony\Component\ErrorCatcher\ErrorHandler;
use Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass;
use Symfony\Component\Form\DependencyInjection\FormPass;
use Symfony\Component\HttpFoundation\Request;
@ -91,7 +91,7 @@ class FrameworkBundle extends Bundle
KernelEvents::FINISH_REQUEST,
];
$this->addCompilerPassIfExists($container, ErrorHandlerPass::class);
$this->addCompilerPassIfExists($container, ErrorCatcherPass::class);
$container->addCompilerPass(new LoggerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, -32);
$container->addCompilerPass(new RegisterControllerArgumentLocatorsPass());
$container->addCompilerPass(new RemoveEmptyControllerArgumentLocatorsPass(), PassConfig::TYPE_BEFORE_REMOVING);

View File

@ -0,0 +1,37 @@
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="error_catcher.error_renderer" class="Symfony\Component\ErrorCatcher\DependencyInjection\ErrorRenderer">
<argument /> <!-- error renderer locator -->
</service>
<service id="error_catcher.renderer.html" class="Symfony\Component\ErrorCatcher\ErrorRenderer\HtmlErrorRenderer">
<tag name="error_catcher.renderer" />
<argument>%kernel.debug%</argument>
<argument>%kernel.charset%</argument>
<argument>%debug.file_link_format%</argument>
</service>
<service id="error_catcher.renderer.json" class="Symfony\Component\ErrorCatcher\ErrorRenderer\JsonErrorRenderer">
<tag name="error_catcher.renderer" />
<argument>%kernel.debug%</argument>
</service>
<service id="error_catcher.renderer.xml" class="Symfony\Component\ErrorCatcher\ErrorRenderer\XmlErrorRenderer">
<tag name="error_catcher.renderer" format="atom" />
<tag name="error_catcher.renderer" />
<argument>%kernel.debug%</argument>
<argument>%kernel.charset%</argument>
</service>
<service id="error_catcher.renderer.txt" class="Symfony\Component\ErrorCatcher\ErrorRenderer\TxtErrorRenderer">
<tag name="error_catcher.renderer" />
<argument>%kernel.debug%</argument>
<argument>%kernel.charset%</argument>
</service>
</services>
</container>

View File

@ -1,39 +0,0 @@
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<defaults public="false" />
<service id="error_handler.error_renderer" class="Symfony\Component\ErrorHandler\DependencyInjection\ErrorRenderer">
<argument /> <!-- error renderer locator -->
</service>
<service id="error_handler.renderer.html" class="Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer">
<tag name="error_handler.renderer" />
<argument>%kernel.debug%</argument>
<argument>%kernel.charset%</argument>
<argument>%debug.file_link_format%</argument>
</service>
<service id="error_handler.renderer.json" class="Symfony\Component\ErrorHandler\ErrorRenderer\JsonErrorRenderer">
<tag name="error_handler.renderer" />
<argument>%kernel.debug%</argument>
</service>
<service id="error_handler.renderer.xml" class="Symfony\Component\ErrorHandler\ErrorRenderer\XmlErrorRenderer">
<tag name="error_handler.renderer" format="atom" />
<tag name="error_handler.renderer" />
<argument>%kernel.debug%</argument>
<argument>%kernel.charset%</argument>
</service>
<service id="error_handler.renderer.txt" class="Symfony\Component\ErrorHandler\ErrorRenderer\TxtErrorRenderer">
<tag name="error_handler.renderer" />
<argument>%kernel.debug%</argument>
<argument>%kernel.charset%</argument>
</service>
</services>
</container>

View File

@ -11,7 +11,7 @@
namespace Symfony\Bundle\TwigBundle\Controller;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Log\DebugLoggerInterface;

View File

@ -11,7 +11,7 @@
namespace Symfony\Bundle\TwigBundle\Controller;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\HttpKernelInterface;

View File

@ -28,7 +28,7 @@ class ExceptionListenerPass implements CompilerPassInterface
}
// register the exception controller only if Twig is enabled and required dependencies do exist
if (!class_exists('Symfony\Component\ErrorHandler\Exception\FlattenException') || !interface_exists('Symfony\Component\EventDispatcher\EventSubscriberInterface')) {
if (!class_exists('Symfony\Component\ErrorCatcher\Exception\FlattenException') || !interface_exists('Symfony\Component\EventDispatcher\EventSubscriberInterface')) {
$container->removeDefinition('twig.exception_listener');
} elseif ($container->hasParameter('templating.engines')) {
$engines = $container->getParameter('templating.engines');

View File

@ -13,7 +13,7 @@ namespace Symfony\Bundle\TwigBundle\Tests\Controller;
use Symfony\Bundle\TwigBundle\Controller\ExceptionController;
use Symfony\Bundle\TwigBundle\Tests\TestCase;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
use Symfony\Component\HttpFoundation\Request;
use Twig\Environment;
use Twig\Loader\ArrayLoader;

View File

@ -13,7 +13,7 @@ namespace Symfony\Bundle\TwigBundle\Tests\Controller;
use Symfony\Bundle\TwigBundle\Controller\PreviewErrorController;
use Symfony\Bundle\TwigBundle\Tests\TestCase;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpKernelInterface;

View File

@ -17,7 +17,7 @@
],
"require": {
"php": "^7.1.3",
"symfony/config": "^4.2|^5.0",
"symfony/error-catcher": "^4.4|^5.0",
"symfony/twig-bridge": "^4.4|^5.0",
"symfony/http-foundation": "^4.3|^5.0",
"symfony/http-kernel": "^4.4|^5.0",
@ -35,7 +35,7 @@
"symfony/templating": "^3.4|^4.0|^5.0",
"symfony/translation": "^4.2|^5.0",
"symfony/yaml": "^3.4|^4.0|^5.0",
"symfony/framework-bundle": "^4.3|^5.0",
"symfony/framework-bundle": "^4.4|^5.0",
"symfony/web-link": "^3.4|^4.0|^5.0",
"doctrine/annotations": "~1.0",
"doctrine/cache": "~1.0"

View File

@ -11,7 +11,7 @@
namespace Symfony\Bundle\WebProfilerBundle\Controller;
use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;
use Symfony\Component\ErrorCatcher\ErrorRenderer\HtmlErrorRenderer;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Debug\FileLinkFormatter;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

View File

@ -27,7 +27,7 @@
<argument type="service" id="twig" />
<argument>%kernel.debug%</argument>
<argument type="service" id="debug.file_link_formatter" />
<argument type="service" id="error_handler.renderer.html" on-invalid="null" />
<argument type="service" id="error_catcher.renderer.html" on-invalid="null" />
</service>
<service id="web_profiler.csp.handler" class="Symfony\Bundle\WebProfilerBundle\Csp\ContentSecurityPolicyHandler">

View File

@ -17,7 +17,7 @@ use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;
use Symfony\Component\ErrorCatcher\ErrorRenderer\HtmlErrorRenderer;
use Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass;
use Symfony\Component\EventDispatcher\EventDispatcher;
@ -54,7 +54,7 @@ class WebProfilerExtensionTest extends TestCase
$this->kernel = $this->getMockBuilder('Symfony\\Component\\HttpKernel\\KernelInterface')->getMock();
$this->container = new ContainerBuilder();
$this->container->register('error_handler.renderer.html', HtmlErrorRenderer::class);
$this->container->register('error_catcher.renderer.html', HtmlErrorRenderer::class);
$this->container->register('event_dispatcher', EventDispatcher::class)->setPublic(true);
$this->container->register('router', $this->getMockClass('Symfony\\Component\\Routing\\RouterInterface'))->setPublic(true);
$this->container->register('twig', 'Twig\Environment')->setPublic(true);

View File

@ -41,8 +41,8 @@ use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Output\ConsoleOutputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\ErrorHandler\ErrorHandler;
use Symfony\Component\ErrorHandler\Exception\FatalThrowableError;
use Symfony\Component\ErrorCatcher\ErrorHandler;
use Symfony\Component\ErrorCatcher\Exception\FatalThrowableError;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;

View File

@ -11,9 +11,9 @@
namespace Symfony\Component\Debug;
use Symfony\Component\ErrorHandler\BufferingLogger;
use Symfony\Component\ErrorHandler\ErrorHandler;
use Symfony\Component\ErrorHandler\ExceptionHandler;
use Symfony\Component\ErrorCatcher\BufferingLogger;
use Symfony\Component\ErrorCatcher\ErrorHandler;
use Symfony\Component\ErrorCatcher\ExceptionHandler;
/**
* Registers all the debug tools.

View File

@ -86,7 +86,7 @@ class DebugClassLoader
public static function enable()
{
// Ensures we don't hit https://bugs.php.net/42098
class_exists('Symfony\Component\ErrorHandler\ErrorHandler');
class_exists('Symfony\Component\ErrorCatcher\ErrorHandler');
class_exists('Psr\Log\LogLevel');
if (!\is_array($functions = spl_autoload_functions())) {

View File

@ -11,12 +11,12 @@
namespace Symfony\Component\Debug;
use Symfony\Component\ErrorHandler\ErrorHandler as BaseErrorHandler;
use Symfony\Component\ErrorCatcher\ErrorHandler as BaseErrorHandler;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', ErrorHandler::class, BaseErrorHandler::class), E_USER_DEPRECATED);
/**
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\ErrorHandler instead.
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorCatcher\ErrorHandler instead.
*/
class ErrorHandler extends BaseErrorHandler
{

View File

@ -11,12 +11,12 @@
namespace Symfony\Component\Debug\Exception;
use Symfony\Component\ErrorHandler\Exception\ClassNotFoundException as BaseClassNotFoundException;
use Symfony\Component\ErrorCatcher\Exception\ClassNotFoundException as BaseClassNotFoundException;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', ClassNotFoundException::class, BaseClassNotFoundException::class), E_USER_DEPRECATED);
/**
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\Exception\ClassNotFoundException instead.
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorCatcher\Exception\ClassNotFoundException instead.
*/
class ClassNotFoundException extends BaseClassNotFoundException
{

View File

@ -11,12 +11,12 @@
namespace Symfony\Component\Debug\Exception;
use Symfony\Component\ErrorHandler\Exception\FatalErrorException as BaseFatalErrorException;
use Symfony\Component\ErrorCatcher\Exception\FatalErrorException as BaseFatalErrorException;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', FatalErrorException::class, BaseFatalErrorException::class), E_USER_DEPRECATED);
/**
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\Exception\FatalErrorException instead.
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorCatcher\Exception\FatalErrorException instead.
*/
class FatalErrorException extends BaseFatalErrorException
{

View File

@ -11,12 +11,12 @@
namespace Symfony\Component\Debug\Exception;
use Symfony\Component\ErrorHandler\Exception\FatalThrowableError as BaseFatalThrowableError;
use Symfony\Component\ErrorCatcher\Exception\FatalThrowableError as BaseFatalThrowableError;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', FatalThrowableError::class, BaseFatalThrowableError::class), E_USER_DEPRECATED);
/**
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\Exception\FatalThrowableError instead.
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorCatcher\Exception\FatalThrowableError instead.
*/
class FatalThrowableError extends BaseFatalThrowableError
{

View File

@ -11,12 +11,12 @@
namespace Symfony\Component\Debug\Exception;
use Symfony\Component\ErrorHandler\Exception\FlattenException as BaseFlattenException;
use Symfony\Component\ErrorCatcher\Exception\FlattenException as BaseFlattenException;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', FlattenException::class, BaseFlattenException::class), E_USER_DEPRECATED);
/**
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\Exception\FlattenException instead.
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorCatcher\Exception\FlattenException instead.
*/
class FlattenException extends BaseFlattenException
{

View File

@ -11,12 +11,12 @@
namespace Symfony\Component\Debug\Exception;
use Symfony\Component\ErrorHandler\Exception\OutOfMemoryException as BaseOutOfMemoryException;
use Symfony\Component\ErrorCatcher\Exception\OutOfMemoryException as BaseOutOfMemoryException;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', OutOfMemoryException::class, BaseOutOfMemoryException::class), E_USER_DEPRECATED);
/**
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\Exception\OutOfMemoryException instead.
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorCatcher\Exception\OutOfMemoryException instead.
*/
class OutOfMemoryException extends BaseOutOfMemoryException
{

View File

@ -11,12 +11,12 @@
namespace Symfony\Component\Debug\Exception;
use Symfony\Component\ErrorHandler\Exception\SilencedErrorContext as BaseSilencedErrorContext;
use Symfony\Component\ErrorCatcher\Exception\SilencedErrorContext as BaseSilencedErrorContext;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', SilencedErrorContext::class, BaseSilencedErrorContext::class), E_USER_DEPRECATED);
/**
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\Exception\SilencedErrorContext instead.
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorCatcher\Exception\SilencedErrorContext instead.
*/
class SilencedErrorContext extends BaseSilencedErrorContext
{

View File

@ -11,12 +11,12 @@
namespace Symfony\Component\Debug\Exception;
use Symfony\Component\ErrorHandler\Exception\UndefinedFunctionException as BaseUndefinedFunctionException;
use Symfony\Component\ErrorCatcher\Exception\UndefinedFunctionException as BaseUndefinedFunctionException;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', UndefinedFunctionException::class, BaseUndefinedFunctionException::class), E_USER_DEPRECATED);
/**
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\Exception\UndefinedFunctionException instead.
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorCatcher\Exception\UndefinedFunctionException instead.
*/
class UndefinedFunctionException extends BaseUndefinedFunctionException
{

View File

@ -11,12 +11,12 @@
namespace Symfony\Component\Debug\Exception;
use Symfony\Component\ErrorHandler\Exception\UndefinedMethodException as BaseUndefinedMethodException;
use Symfony\Component\ErrorCatcher\Exception\UndefinedMethodException as BaseUndefinedMethodException;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', UndefinedMethodException::class, BaseUndefinedMethodException::class), E_USER_DEPRECATED);
/**
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\Exception\UndefinedMethodException instead.
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorCatcher\Exception\UndefinedMethodException instead.
*/
class UndefinedMethodException extends BaseUndefinedMethodException
{

View File

@ -11,12 +11,12 @@
namespace Symfony\Component\Debug;
use Symfony\Component\ErrorHandler\ExceptionHandler as BaseExceptionHandler;
use Symfony\Component\ErrorCatcher\ExceptionHandler as BaseExceptionHandler;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', ExceptionHandler::class, BaseExceptionHandler::class), E_USER_DEPRECATED);
/**
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\ExceptionHandler instead.
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorCatcher\ExceptionHandler instead.
*/
class ExceptionHandler extends BaseExceptionHandler
{

View File

@ -11,12 +11,12 @@
namespace Symfony\Component\Debug\FatalErrorHandler;
use Symfony\Component\ErrorHandler\FatalErrorHandler\ClassNotFoundFatalErrorHandler as BaseClassNotFoundFatalErrorHandler;
use Symfony\Component\ErrorCatcher\FatalErrorHandler\ClassNotFoundFatalErrorHandler as BaseClassNotFoundFatalErrorHandler;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', ClassNotFoundFatalErrorHandler::class, BaseClassNotFoundFatalErrorHandler::class), E_USER_DEPRECATED);
/**
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\FatalErrorHandler\ClassNotFoundFatalErrorHandler instead.
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorCatcher\FatalErrorHandler\ClassNotFoundFatalErrorHandler instead.
*/
class ClassNotFoundFatalErrorHandler extends BaseClassNotFoundFatalErrorHandler
{

View File

@ -11,12 +11,12 @@
namespace Symfony\Component\Debug\FatalErrorHandler;
use Symfony\Component\ErrorHandler\FatalErrorHandler\FatalErrorHandlerInterface as BaseFatalErrorHandlerInterface;
use Symfony\Component\ErrorCatcher\FatalErrorHandler\FatalErrorHandlerInterface as BaseFatalErrorHandlerInterface;
@trigger_error(sprintf('The "%s" interface is deprecated since Symfony 4.4, use "%s" instead.', FatalErrorHandlerInterface::class, BaseFatalErrorHandlerInterface::class), E_USER_DEPRECATED);
/**
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\FatalErrorHandler\FatalErrorHandlerInterface instead.
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorCatcher\FatalErrorHandler\FatalErrorHandlerInterface instead.
*/
interface FatalErrorHandlerInterface extends BaseFatalErrorHandlerInterface
{

View File

@ -11,12 +11,12 @@
namespace Symfony\Component\Debug\FatalErrorHandler;
use Symfony\Component\ErrorHandler\FatalErrorHandler\UndefinedFunctionFatalErrorHandler as BaseUndefinedFunctionFatalErrorHandler;
use Symfony\Component\ErrorCatcher\FatalErrorHandler\UndefinedFunctionFatalErrorHandler as BaseUndefinedFunctionFatalErrorHandler;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', UndefinedFunctionFatalErrorHandler::class, BaseUndefinedFunctionFatalErrorHandler::class), E_USER_DEPRECATED);
/**
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\FatalErrorHandler\UndefinedFunctionFatalErrorHandler instead.
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorCatcher\FatalErrorHandler\UndefinedFunctionFatalErrorHandler instead.
*/
class UndefinedFunctionFatalErrorHandler extends BaseUndefinedFunctionFatalErrorHandler
{

View File

@ -11,12 +11,12 @@
namespace Symfony\Component\Debug\FatalErrorHandler;
use Symfony\Component\ErrorHandler\FatalErrorHandler\UndefinedMethodFatalErrorHandler as BaseUndefinedMethodFatalErrorHandler;
use Symfony\Component\ErrorCatcher\FatalErrorHandler\UndefinedMethodFatalErrorHandler as BaseUndefinedMethodFatalErrorHandler;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', UndefinedMethodFatalErrorHandler::class, BaseUndefinedMethodFatalErrorHandler::class), E_USER_DEPRECATED);
/**
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\FatalErrorHandler\UndefinedMethodFatalErrorHandler instead.
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorCatcher\FatalErrorHandler\UndefinedMethodFatalErrorHandler instead.
*/
class UndefinedMethodFatalErrorHandler extends BaseUndefinedMethodFatalErrorHandler
{

View File

@ -18,7 +18,7 @@
"require": {
"php": "^7.1.3",
"psr/log": "~1.0",
"symfony/error-handler": "^4.4"
"symfony/error-catcher": "^4.4|^5.0"
},
"conflict": {
"symfony/http-kernel": "<3.4"

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler;
namespace Symfony\Component\ErrorCatcher;
use Psr\Log\AbstractLogger;

View File

@ -9,23 +9,23 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\DependencyInjection;
namespace Symfony\Component\ErrorCatcher\DependencyInjection;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\ErrorHandler\ErrorRenderer\ErrorRendererInterface;
use Symfony\Component\ErrorCatcher\ErrorRenderer\ErrorRendererInterface;
/**
* @author Yonel Ceruto <yonelceruto@gmail.com>
*/
class ErrorHandlerPass implements CompilerPassInterface
class ErrorCatcherPass implements CompilerPassInterface
{
private $rendererService;
private $rendererTag;
public function __construct(string $rendererService = 'error_handler.error_renderer', string $rendererTag = 'error_handler.renderer')
public function __construct(string $rendererService = 'error_catcher.error_renderer', string $rendererTag = 'error_catcher.renderer')
{
$this->rendererService = $rendererService;
$this->rendererTag = $rendererTag;

View File

@ -9,10 +9,10 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\DependencyInjection;
namespace Symfony\Component\ErrorCatcher\DependencyInjection;
use Psr\Container\ContainerInterface;
use Symfony\Component\ErrorHandler\ErrorRenderer\ErrorRenderer as BaseErrorRenderer;
use Symfony\Component\ErrorCatcher\ErrorRenderer\ErrorRenderer as BaseErrorRenderer;
/**
* Lazily loads error renderers from the dependency injection container.

View File

@ -9,20 +9,20 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler;
namespace Symfony\Component\ErrorCatcher;
use Psr\Log\LoggerInterface;
use Psr\Log\LogLevel;
use Symfony\Component\Debug\DebugClassLoader;
use Symfony\Component\ErrorHandler\Exception\FatalErrorException;
use Symfony\Component\ErrorHandler\Exception\FatalThrowableError;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorHandler\Exception\OutOfMemoryException;
use Symfony\Component\ErrorHandler\Exception\SilencedErrorContext;
use Symfony\Component\ErrorHandler\FatalErrorHandler\ClassNotFoundFatalErrorHandler;
use Symfony\Component\ErrorHandler\FatalErrorHandler\FatalErrorHandlerInterface;
use Symfony\Component\ErrorHandler\FatalErrorHandler\UndefinedFunctionFatalErrorHandler;
use Symfony\Component\ErrorHandler\FatalErrorHandler\UndefinedMethodFatalErrorHandler;
use Symfony\Component\ErrorCatcher\Exception\FatalErrorException;
use Symfony\Component\ErrorCatcher\Exception\FatalThrowableError;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\Exception\OutOfMemoryException;
use Symfony\Component\ErrorCatcher\Exception\SilencedErrorContext;
use Symfony\Component\ErrorCatcher\FatalErrorHandler\ClassNotFoundFatalErrorHandler;
use Symfony\Component\ErrorCatcher\FatalErrorHandler\FatalErrorHandlerInterface;
use Symfony\Component\ErrorCatcher\FatalErrorHandler\UndefinedFunctionFatalErrorHandler;
use Symfony\Component\ErrorCatcher\FatalErrorHandler\UndefinedMethodFatalErrorHandler;
/**
* A generic ErrorHandler for the PHP engine.

View File

@ -9,10 +9,10 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\ErrorRenderer;
namespace Symfony\Component\ErrorCatcher\ErrorRenderer;
use Symfony\Component\ErrorHandler\Exception\ErrorRendererNotFoundException;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\Exception\ErrorRendererNotFoundException;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
/**
* Renders an Exception that represents a Response content.

View File

@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\ErrorRenderer;
namespace Symfony\Component\ErrorCatcher\ErrorRenderer;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
/**
* Interface implemented by all error renderers.

View File

@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\ErrorRenderer;
namespace Symfony\Component\ErrorCatcher\ErrorRenderer;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
use Symfony\Component\HttpKernel\Debug\FileLinkFormatter;
/**

View File

@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\ErrorRenderer;
namespace Symfony\Component\ErrorCatcher\ErrorRenderer;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
/**
* @author Yonel Ceruto <yonelceruto@gmail.com>

View File

@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\ErrorRenderer;
namespace Symfony\Component\ErrorCatcher\ErrorRenderer;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
/**
* @author Yonel Ceruto <yonelceruto@gmail.com>

View File

@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\ErrorRenderer;
namespace Symfony\Component\ErrorCatcher\ErrorRenderer;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
/**
* @author Yonel Ceruto <yonelceruto@gmail.com>

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\Exception;
namespace Symfony\Component\ErrorCatcher\Exception;
/**
* Class (or Trait or Interface) Not Found Exception.

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\Exception;
namespace Symfony\Component\ErrorCatcher\Exception;
class ErrorRendererNotFoundException extends \RuntimeException
{

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\Exception;
namespace Symfony\Component\ErrorCatcher\Exception;
/**
* Fatal Error Exception.

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\Exception;
namespace Symfony\Component\ErrorCatcher\Exception;
/**
* Fatal Throwable Error.

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\Exception;
namespace Symfony\Component\ErrorCatcher\Exception;
use Symfony\Component\HttpFoundation\Exception\RequestExceptionInterface;
use Symfony\Component\HttpFoundation\Response;

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\Exception;
namespace Symfony\Component\ErrorCatcher\Exception;
/**
* Out of memory exception.

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\Exception;
namespace Symfony\Component\ErrorCatcher\Exception;
/**
* Data Object that represents a Silenced Error.

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\Exception;
namespace Symfony\Component\ErrorCatcher\Exception;
/**
* Undefined Function Exception.

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\Exception;
namespace Symfony\Component\ErrorCatcher\Exception;
/**
* Undefined Method Exception.

View File

@ -9,11 +9,11 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler;
namespace Symfony\Component\ErrorCatcher;
use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorHandler\Exception\OutOfMemoryException;
use Symfony\Component\ErrorCatcher\ErrorRenderer\HtmlErrorRenderer;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\Exception\OutOfMemoryException;
use Symfony\Component\HttpKernel\Debug\FileLinkFormatter;
/**

View File

@ -9,13 +9,13 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\FatalErrorHandler;
namespace Symfony\Component\ErrorCatcher\FatalErrorHandler;
use Composer\Autoload\ClassLoader as ComposerClassLoader;
use Symfony\Component\ClassLoader\ClassLoader as SymfonyClassLoader;
use Symfony\Component\Debug\DebugClassLoader;
use Symfony\Component\ErrorHandler\Exception\ClassNotFoundException;
use Symfony\Component\ErrorHandler\Exception\FatalErrorException;
use Symfony\Component\ErrorCatcher\Exception\ClassNotFoundException;
use Symfony\Component\ErrorCatcher\Exception\FatalErrorException;
/**
* ErrorHandler for classes that do not exist.

View File

@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\FatalErrorHandler;
namespace Symfony\Component\ErrorCatcher\FatalErrorHandler;
use Symfony\Component\ErrorHandler\Exception\FatalErrorException;
use Symfony\Component\ErrorCatcher\Exception\FatalErrorException;
/**
* Attempts to convert fatal errors to exceptions.

View File

@ -9,10 +9,10 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\FatalErrorHandler;
namespace Symfony\Component\ErrorCatcher\FatalErrorHandler;
use Symfony\Component\ErrorHandler\Exception\FatalErrorException;
use Symfony\Component\ErrorHandler\Exception\UndefinedFunctionException;
use Symfony\Component\ErrorCatcher\Exception\FatalErrorException;
use Symfony\Component\ErrorCatcher\Exception\UndefinedFunctionException;
/**
* ErrorHandler for undefined functions.

View File

@ -9,10 +9,10 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\FatalErrorHandler;
namespace Symfony\Component\ErrorCatcher\FatalErrorHandler;
use Symfony\Component\ErrorHandler\Exception\FatalErrorException;
use Symfony\Component\ErrorHandler\Exception\UndefinedMethodException;
use Symfony\Component\ErrorCatcher\Exception\FatalErrorException;
use Symfony\Component\ErrorCatcher\Exception\UndefinedMethodException;
/**
* ErrorHandler for undefined methods.

View File

@ -1,7 +1,7 @@
ErrorHandler Component
ErrorCatcher Component
======================
The ErrorHandler component provides tools to manage and display errors and exceptions.
The ErrorCatcher component provides tools to manage and display errors and exceptions.
Resources
---------

View File

@ -9,42 +9,42 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\Tests\DependencyInjection;
namespace Symfony\Component\ErrorCatcher\Tests\DependencyInjection;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\ServiceLocator;
use Symfony\Component\ErrorHandler\DependencyInjection\ErrorHandlerPass;
use Symfony\Component\ErrorHandler\DependencyInjection\ErrorRenderer;
use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;
use Symfony\Component\ErrorHandler\ErrorRenderer\JsonErrorRenderer;
use Symfony\Component\ErrorCatcher\DependencyInjection\ErrorCatcherPass;
use Symfony\Component\ErrorCatcher\DependencyInjection\ErrorRenderer;
use Symfony\Component\ErrorCatcher\ErrorRenderer\HtmlErrorRenderer;
use Symfony\Component\ErrorCatcher\ErrorRenderer\JsonErrorRenderer;
class ErrorHandlerPassTest extends TestCase
class ErrorPassTest extends TestCase
{
public function testProcess()
{
$container = new ContainerBuilder();
$container->setParameter('kernel.debug', true);
$definition = $container->register('error_handler.error_renderer', ErrorRenderer::class)
$definition = $container->register('error_catcher.error_renderer', ErrorRenderer::class)
->addArgument([])
;
$container->register('error_handler.renderer.html', HtmlErrorRenderer::class)
->addTag('error_handler.renderer')
$container->register('error_catcher.renderer.html', HtmlErrorRenderer::class)
->addTag('error_catcher.renderer')
;
$container->register('error_handler.renderer.json', JsonErrorRenderer::class)
->addTag('error_handler.renderer')
$container->register('error_catcher.renderer.json', JsonErrorRenderer::class)
->addTag('error_catcher.renderer')
;
(new ErrorHandlerPass())->process($container);
(new ErrorCatcherPass())->process($container);
$serviceLocatorDefinition = $container->getDefinition((string) $definition->getArgument(0));
$this->assertSame(ServiceLocator::class, $serviceLocatorDefinition->getClass());
$expected = [
'html' => new ServiceClosureArgument(new Reference('error_handler.renderer.html')),
'json' => new ServiceClosureArgument(new Reference('error_handler.renderer.json')),
'html' => new ServiceClosureArgument(new Reference('error_catcher.renderer.html')),
'json' => new ServiceClosureArgument(new Reference('error_catcher.renderer.json')),
];
$this->assertEquals($expected, $serviceLocatorDefinition->getArgument(0));
}

View File

@ -9,17 +9,17 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\Tests\DependencyInjection;
namespace Symfony\Component\ErrorCatcher\Tests\DependencyInjection;
use PHPUnit\Framework\TestCase;
use Symfony\Component\ErrorHandler\DependencyInjection\ErrorRenderer;
use Symfony\Component\ErrorHandler\ErrorRenderer\ErrorRendererInterface;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\DependencyInjection\ErrorRenderer;
use Symfony\Component\ErrorCatcher\ErrorRenderer\ErrorRendererInterface;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
class ErrorRendererTest extends TestCase
{
/**
* @expectedException \Symfony\Component\ErrorHandler\Exception\ErrorRendererNotFoundException
* @expectedException \Symfony\Component\ErrorCatcher\Exception\ErrorRendererNotFoundException
* @expectedExceptionMessage No error renderer found for format "foo".
*/
public function testInvalidErrorRenderer()

View File

@ -9,16 +9,16 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\Tests;
namespace Symfony\Component\ErrorCatcher\Tests;
use PHPUnit\Framework\TestCase;
use Psr\Log\LogLevel;
use Psr\Log\NullLogger;
use Symfony\Component\ErrorHandler\BufferingLogger;
use Symfony\Component\ErrorHandler\ErrorHandler;
use Symfony\Component\ErrorHandler\Exception\SilencedErrorContext;
use Symfony\Component\ErrorHandler\Tests\Fixtures\ErrorHandlerThatUsesThePreviousOne;
use Symfony\Component\ErrorHandler\Tests\Fixtures\LoggerThatSetAnErrorHandler;
use Symfony\Component\ErrorCatcher\BufferingLogger;
use Symfony\Component\ErrorCatcher\ErrorHandler;
use Symfony\Component\ErrorCatcher\Exception\SilencedErrorContext;
use Symfony\Component\ErrorCatcher\Tests\Fixtures\ErrorHandlerThatUsesThePreviousOne;
use Symfony\Component\ErrorCatcher\Tests\Fixtures\LoggerThatSetAnErrorHandler;
/**
* ErrorHandlerTest.
@ -33,7 +33,7 @@ class ErrorHandlerTest extends TestCase
$handler = ErrorHandler::register();
try {
$this->assertInstanceOf('Symfony\Component\ErrorHandler\ErrorHandler', $handler);
$this->assertInstanceOf('Symfony\Component\ErrorCatcher\ErrorHandler', $handler);
$this->assertSame($handler, ErrorHandler::register());
$newHandler = new ErrorHandler();
@ -490,7 +490,7 @@ class ErrorHandlerTest extends TestCase
$handler->handleException($exception);
$this->assertInstanceOf('Symfony\Component\ErrorHandler\Exception\ClassNotFoundException', $args[0]);
$this->assertInstanceOf('Symfony\Component\ErrorCatcher\Exception\ClassNotFoundException', $args[0]);
$this->assertStringStartsWith("Attempted to load class \"IReallyReallyDoNotExistAnywhereInTheRepositoryISwear\" from the global namespace.\nDid you forget a \"use\" statement", $args[0]->getMessage());
}

View File

@ -9,17 +9,17 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\Tests\ErrorRenderer;
namespace Symfony\Component\ErrorCatcher\Tests\ErrorRenderer;
use PHPUnit\Framework\TestCase;
use Symfony\Component\ErrorHandler\ErrorRenderer\ErrorRenderer;
use Symfony\Component\ErrorHandler\ErrorRenderer\ErrorRendererInterface;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\ErrorRenderer\ErrorRenderer;
use Symfony\Component\ErrorCatcher\ErrorRenderer\ErrorRendererInterface;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
class ErrorRendererTest extends TestCase
{
/**
* @expectedException \Symfony\Component\ErrorHandler\Exception\ErrorRendererNotFoundException
* @expectedException \Symfony\Component\ErrorCatcher\Exception\ErrorRendererNotFoundException
* @expectedExceptionMessage No error renderer found for format "foo".
*/
public function testErrorRendererNotFound()
@ -30,7 +30,7 @@ class ErrorRendererTest extends TestCase
/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage Error renderer "stdClass" must implement "Symfony\Component\ErrorHandler\ErrorRenderer\ErrorRendererInterface".
* @expectedExceptionMessage Error renderer "stdClass" must implement "Symfony\Component\ErrorCatcher\ErrorRenderer\ErrorRendererInterface".
*/
public function testInvalidErrorRenderer()
{

View File

@ -9,11 +9,11 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\Tests\ErrorRenderer;
namespace Symfony\Component\ErrorCatcher\Tests\ErrorRenderer;
use PHPUnit\Framework\TestCase;
use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\ErrorRenderer\HtmlErrorRenderer;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
class HtmlErrorRendererTest extends TestCase
{

View File

@ -9,11 +9,11 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\Tests\ErrorRenderer;
namespace Symfony\Component\ErrorCatcher\Tests\ErrorRenderer;
use PHPUnit\Framework\TestCase;
use Symfony\Component\ErrorHandler\ErrorRenderer\JsonErrorRenderer;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\ErrorRenderer\JsonErrorRenderer;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
class JsonErrorRendererTest extends TestCase
{

View File

@ -9,11 +9,11 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\Tests\ErrorRenderer;
namespace Symfony\Component\ErrorCatcher\Tests\ErrorRenderer;
use PHPUnit\Framework\TestCase;
use Symfony\Component\ErrorHandler\ErrorRenderer\TxtErrorRenderer;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\ErrorRenderer\TxtErrorRenderer;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
class TxtErrorRendererTest extends TestCase
{

View File

@ -9,11 +9,11 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\Tests\ErrorRenderer;
namespace Symfony\Component\ErrorCatcher\Tests\ErrorRenderer;
use PHPUnit\Framework\TestCase;
use Symfony\Component\ErrorHandler\ErrorRenderer\XmlErrorRenderer;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\ErrorRenderer\XmlErrorRenderer;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
class XmlErrorRendererTest extends TestCase
{

View File

@ -9,11 +9,11 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\Tests\Exception;
namespace Symfony\Component\ErrorCatcher\Tests\Exception;
use PHPUnit\Framework\TestCase;
use Symfony\Component\ErrorHandler\Exception\FatalThrowableError;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\Exception\FatalThrowableError;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
use Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;

View File

@ -9,11 +9,11 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\Tests;
namespace Symfony\Component\ErrorCatcher\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Component\ErrorHandler\Exception\OutOfMemoryException;
use Symfony\Component\ErrorHandler\ExceptionHandler;
use Symfony\Component\ErrorCatcher\Exception\OutOfMemoryException;
use Symfony\Component\ErrorCatcher\ExceptionHandler;
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
@ -110,7 +110,7 @@ content="0;url=data:text/html;base64,PHNjcmlwdD5hbGVydCgndGVzdDMnKTwvc2NyaXB0Pg"
{
$exception = new \Exception('foo');
$handler = $this->getMockBuilder('Symfony\Component\ErrorHandler\ExceptionHandler')->setMethods(['sendPhpResponse'])->getMock();
$handler = $this->getMockBuilder('Symfony\Component\ErrorCatcher\ExceptionHandler')->setMethods(['sendPhpResponse'])->getMock();
$handler
->expects($this->exactly(2))
->method('sendPhpResponse');
@ -128,7 +128,7 @@ content="0;url=data:text/html;base64,PHNjcmlwdD5hbGVydCgndGVzdDMnKTwvc2NyaXB0Pg"
{
$exception = new OutOfMemoryException('foo', 0, E_ERROR, __FILE__, __LINE__);
$handler = $this->getMockBuilder('Symfony\Component\ErrorHandler\ExceptionHandler')->setMethods(['sendPhpResponse'])->getMock();
$handler = $this->getMockBuilder('Symfony\Component\ErrorCatcher\ExceptionHandler')->setMethods(['sendPhpResponse'])->getMock();
$handler
->expects($this->once())
->method('sendPhpResponse');

View File

@ -9,13 +9,13 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\Tests\FatalErrorHandler;
namespace Symfony\Component\ErrorCatcher\Tests\FatalErrorHandler;
use Composer\Autoload\ClassLoader as ComposerClassLoader;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Debug\DebugClassLoader;
use Symfony\Component\ErrorHandler\Exception\FatalErrorException;
use Symfony\Component\ErrorHandler\FatalErrorHandler\ClassNotFoundFatalErrorHandler;
use Symfony\Component\ErrorCatcher\Exception\FatalErrorException;
use Symfony\Component\ErrorCatcher\FatalErrorHandler\ClassNotFoundFatalErrorHandler;
class ClassNotFoundFatalErrorHandlerTest extends TestCase
{
@ -32,7 +32,7 @@ class ClassNotFoundFatalErrorHandlerTest extends TestCase
}
if ($function[0] instanceof ComposerClassLoader) {
$function[0]->add('Symfony_Component_ErrorHandler_Tests_Fixtures', \dirname(\dirname(\dirname(\dirname(\dirname(__DIR__))))));
$function[0]->add('Symfony_Component_ErrorCatcher_Tests_Fixtures', \dirname(\dirname(\dirname(\dirname(\dirname(__DIR__))))));
break;
}
}
@ -60,7 +60,7 @@ class ClassNotFoundFatalErrorHandlerTest extends TestCase
array_map('spl_autoload_register', $autoloaders);
}
$this->assertInstanceOf('Symfony\Component\ErrorHandler\Exception\ClassNotFoundException', $exception);
$this->assertInstanceOf('Symfony\Component\ErrorCatcher\Exception\ClassNotFoundException', $exception);
$this->assertSame($translatedMessage, $exception->getMessage());
$this->assertSame($error['type'], $exception->getSeverity());
$this->assertSame($error['file'], $exception->getFile());
@ -70,7 +70,7 @@ class ClassNotFoundFatalErrorHandlerTest extends TestCase
public function provideClassNotFoundData()
{
$autoloader = new ComposerClassLoader();
$autoloader->add('Symfony\Component\ErrorHandler\Exception\\', realpath(__DIR__.'/../../Exception'));
$autoloader->add('Symfony\Component\ErrorCatcher\Exception\\', realpath(__DIR__.'/../../Exception'));
$debugClassLoader = new DebugClassLoader([$autoloader, 'loadClass']);
@ -100,7 +100,7 @@ class ClassNotFoundFatalErrorHandlerTest extends TestCase
'file' => 'foo.php',
'message' => 'Class \'UndefinedFuncException\' not found',
],
"Attempted to load class \"UndefinedFuncException\" from the global namespace.\nDid you forget a \"use\" statement for \"Symfony\Component\ErrorHandler\Tests\Fixtures\UndefinedFuncException\"?",
"Attempted to load class \"UndefinedFuncException\" from the global namespace.\nDid you forget a \"use\" statement for \"Symfony\Component\ErrorCatcher\Tests\Fixtures\UndefinedFuncException\"?",
],
[
[
@ -109,7 +109,7 @@ class ClassNotFoundFatalErrorHandlerTest extends TestCase
'file' => 'foo.php',
'message' => 'Class \'PEARClass\' not found',
],
"Attempted to load class \"PEARClass\" from the global namespace.\nDid you forget a \"use\" statement for \"Symfony_Component_ErrorHandler_Tests_Fixtures_PEARClass\"?",
"Attempted to load class \"PEARClass\" from the global namespace.\nDid you forget a \"use\" statement for \"Symfony_Component_ErrorCatcher_Tests_Fixtures_PEARClass\"?",
],
[
[
@ -118,7 +118,7 @@ class ClassNotFoundFatalErrorHandlerTest extends TestCase
'file' => 'foo.php',
'message' => 'Class \'Foo\\Bar\\UndefinedFuncException\' not found',
],
"Attempted to load class \"UndefinedFuncException\" from namespace \"Foo\Bar\".\nDid you forget a \"use\" statement for \"Symfony\Component\ErrorHandler\Tests\Fixtures\UndefinedFuncException\"?",
"Attempted to load class \"UndefinedFuncException\" from namespace \"Foo\Bar\".\nDid you forget a \"use\" statement for \"Symfony\Component\ErrorCatcher\Tests\Fixtures\UndefinedFuncException\"?",
],
[
[
@ -127,7 +127,7 @@ class ClassNotFoundFatalErrorHandlerTest extends TestCase
'file' => 'foo.php',
'message' => 'Class \'Foo\\Bar\\UndefinedFunctionException\' not found',
],
"Attempted to load class \"UndefinedFunctionException\" from namespace \"Foo\Bar\".\nDid you forget a \"use\" statement for \"Symfony\Component\ErrorHandler\Exception\UndefinedFunctionException\"?",
"Attempted to load class \"UndefinedFunctionException\" from namespace \"Foo\Bar\".\nDid you forget a \"use\" statement for \"Symfony\Component\ErrorCatcher\Exception\UndefinedFunctionException\"?",
[$autoloader, 'loadClass'],
],
[
@ -137,7 +137,7 @@ class ClassNotFoundFatalErrorHandlerTest extends TestCase
'file' => 'foo.php',
'message' => 'Class \'Foo\\Bar\\UndefinedFunctionException\' not found',
],
"Attempted to load class \"UndefinedFunctionException\" from namespace \"Foo\Bar\".\nDid you forget a \"use\" statement for \"Symfony\Component\ErrorHandler\Exception\UndefinedFunctionException\"?",
"Attempted to load class \"UndefinedFunctionException\" from namespace \"Foo\Bar\".\nDid you forget a \"use\" statement for \"Symfony\Component\ErrorCatcher\Exception\UndefinedFunctionException\"?",
[$debugClassLoader, 'loadClass'],
],
[
@ -171,6 +171,6 @@ class ClassNotFoundFatalErrorHandlerTest extends TestCase
$handler = new ClassNotFoundFatalErrorHandler();
$exception = $handler->handleError($error, new FatalErrorException('', 0, $error['type'], $error['file'], $error['line']));
$this->assertInstanceOf('Symfony\Component\ErrorHandler\Exception\ClassNotFoundException', $exception);
$this->assertInstanceOf('Symfony\Component\ErrorCatcher\Exception\ClassNotFoundException', $exception);
}
}

View File

@ -9,11 +9,11 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\Tests\FatalErrorHandler;
namespace Symfony\Component\ErrorCatcher\Tests\FatalErrorHandler;
use PHPUnit\Framework\TestCase;
use Symfony\Component\ErrorHandler\Exception\FatalErrorException;
use Symfony\Component\ErrorHandler\FatalErrorHandler\UndefinedFunctionFatalErrorHandler;
use Symfony\Component\ErrorCatcher\Exception\FatalErrorException;
use Symfony\Component\ErrorCatcher\FatalErrorHandler\UndefinedFunctionFatalErrorHandler;
class UndefinedFunctionFatalErrorHandlerTest extends TestCase
{
@ -25,7 +25,7 @@ class UndefinedFunctionFatalErrorHandlerTest extends TestCase
$handler = new UndefinedFunctionFatalErrorHandler();
$exception = $handler->handleError($error, new FatalErrorException('', 0, $error['type'], $error['file'], $error['line']));
$this->assertInstanceOf('Symfony\Component\ErrorHandler\Exception\UndefinedFunctionException', $exception);
$this->assertInstanceOf('Symfony\Component\ErrorCatcher\Exception\UndefinedFunctionException', $exception);
// class names are case insensitive and PHP do not return the same
$this->assertSame(strtolower($translatedMessage), strtolower($exception->getMessage()));
$this->assertSame($error['type'], $exception->getSeverity());
@ -43,7 +43,7 @@ class UndefinedFunctionFatalErrorHandlerTest extends TestCase
'file' => 'foo.php',
'message' => 'Call to undefined function test_namespaced_function()',
],
"Attempted to call function \"test_namespaced_function\" from the global namespace.\nDid you mean to call \"\\symfony\\component\\errorhandler\\tests\\fatalerrorhandler\\test_namespaced_function\"?",
"Attempted to call function \"test_namespaced_function\" from the global namespace.\nDid you mean to call \"\\symfony\\component\\errorcatcher\\tests\\fatalerrorhandler\\test_namespaced_function\"?",
],
[
[
@ -52,7 +52,7 @@ class UndefinedFunctionFatalErrorHandlerTest extends TestCase
'file' => 'foo.php',
'message' => 'Call to undefined function Foo\\Bar\\Baz\\test_namespaced_function()',
],
"Attempted to call function \"test_namespaced_function\" from namespace \"Foo\\Bar\\Baz\".\nDid you mean to call \"\\symfony\\component\\errorhandler\\tests\\fatalerrorhandler\\test_namespaced_function\"?",
"Attempted to call function \"test_namespaced_function\" from namespace \"Foo\\Bar\\Baz\".\nDid you mean to call \"\\symfony\\component\\errorcatcher\\tests\\fatalerrorhandler\\test_namespaced_function\"?",
],
[
[

View File

@ -9,11 +9,11 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\Tests\FatalErrorHandler;
namespace Symfony\Component\ErrorCatcher\Tests\FatalErrorHandler;
use PHPUnit\Framework\TestCase;
use Symfony\Component\ErrorHandler\Exception\FatalErrorException;
use Symfony\Component\ErrorHandler\FatalErrorHandler\UndefinedMethodFatalErrorHandler;
use Symfony\Component\ErrorCatcher\Exception\FatalErrorException;
use Symfony\Component\ErrorCatcher\FatalErrorHandler\UndefinedMethodFatalErrorHandler;
class UndefinedMethodFatalErrorHandlerTest extends TestCase
{
@ -25,7 +25,7 @@ class UndefinedMethodFatalErrorHandlerTest extends TestCase
$handler = new UndefinedMethodFatalErrorHandler();
$exception = $handler->handleError($error, new FatalErrorException('', 0, $error['type'], $error['file'], $error['line']));
$this->assertInstanceOf('Symfony\Component\ErrorHandler\Exception\UndefinedMethodException', $exception);
$this->assertInstanceOf('Symfony\Component\ErrorCatcher\Exception\UndefinedMethodException', $exception);
$this->assertSame($translatedMessage, $exception->getMessage());
$this->assertSame($error['type'], $exception->getSeverity());
$this->assertSame($error['file'], $exception->getFile());

View File

@ -1,6 +1,6 @@
<?php
namespace Symfony\Component\ErrorHandler\Tests\Fixtures;
namespace Symfony\Component\ErrorCatcher\Tests\Fixtures;
class ErrorHandlerThatUsesThePreviousOne
{

View File

@ -1,6 +1,6 @@
<?php
namespace Symfony\Component\ErrorHandler\Tests\Fixtures;
namespace Symfony\Component\ErrorCatcher\Tests\Fixtures;
use Psr\Log\AbstractLogger;

View File

@ -0,0 +1,5 @@
<?php
class Symfony_Component_ErrorCatcher_Tests_Fixtures_PEARClass
{
}

View File

@ -1,6 +1,6 @@
<?php
namespace Symfony\Component\ErrorHandler\Tests\Fixtures;
namespace Symfony\Component\ErrorCatcher\Tests\Fixtures;
class ToStringThrower
{

View File

@ -0,0 +1,7 @@
<?php
namespace Symfony\Component\ErrorCatcher\Tests\Fixtures;
class UndefinedFuncException
{
}

View File

@ -0,0 +1,7 @@
<?php
namespace Symfony\Component\ErrorCatcher\Tests\Fixtures2;
class RequiredTwice
{
}

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler;
namespace Symfony\Component\ErrorCatcher;
function headers_sent()
{
@ -21,7 +21,7 @@ function header($str, $replace = true, $status = null)
Tests\testHeader($str, $replace, $status);
}
namespace Symfony\Component\ErrorHandler\Tests;
namespace Symfony\Component\ErrorCatcher\Tests;
function testHeader()
{

View File

@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\Tests;
namespace Symfony\Component\ErrorCatcher\Tests;
use Symfony\Component\ErrorHandler\ExceptionHandler;
use Symfony\Component\ErrorCatcher\ExceptionHandler;
class MockExceptionHandler extends ExceptionHandler
{

View File

@ -5,7 +5,7 @@ display_errors=0
--FILE--
<?php
namespace Symfony\Component\ErrorHandler;
namespace Symfony\Component\ErrorCatcher;
$vendor = __DIR__;
while (!file_exists($vendor.'/vendor')) {
@ -26,9 +26,9 @@ if (true) {
?>
--EXPECTF--
object(Symfony\Component\ErrorHandler\Exception\ClassNotFoundException)#%d (8) {
object(Symfony\Component\ErrorCatcher\Exception\ClassNotFoundException)#%d (8) {
["message":protected]=>
string(138) "Attempted to load class "missing" from namespace "Symfony\Component\ErrorHandler".
string(138) "Attempted to load class "missing" from namespace "Symfony\Component\ErrorCatcher".
Did you forget a "use" statement for another namespace?"
["string":"Exception":private]=>
string(0) ""

View File

@ -3,7 +3,7 @@ Test rethrowing in custom exception handler
--FILE--
<?php
namespace Symfony\Component\ErrorHandler;
namespace Symfony\Component\ErrorCatcher;
$vendor = __DIR__;
while (!file_exists($vendor.'/vendor')) {

View File

@ -3,7 +3,7 @@ Test catching fatal errors when handlers are nested
--FILE--
<?php
namespace Symfony\Component\ErrorHandler;
namespace Symfony\Component\ErrorCatcher;
use Symfony\Component\Debug\Debug;
@ -37,8 +37,8 @@ array(1) {
[0]=>
string(37) "Error and exception handlers do match"
}
object(Symfony\Component\ErrorHandler\Exception\FatalErrorException)#%d (%d) {
object(Symfony\Component\ErrorCatcher\Exception\FatalErrorException)#%d (%d) {
["message":protected]=>
string(186) "Error: Class Symfony\Component\ErrorHandler\Broken contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (JsonSerializable::jsonSerialize)"
string(186) "Error: Class Symfony\Component\ErrorCatcher\Broken contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (JsonSerializable::jsonSerialize)"
%a
}

View File

@ -1,7 +1,7 @@
{
"name": "symfony/error-handler",
"name": "symfony/error-catcher",
"type": "library",
"description": "Symfony ErrorHandler Component",
"description": "Symfony ErrorCatcher Component",
"keywords": [],
"homepage": "https://symfony.com",
"license": "MIT",
@ -28,7 +28,7 @@
"symfony/http-kernel": "<4.4"
},
"autoload": {
"psr-4": { "Symfony\\Component\\ErrorHandler\\": "" },
"psr-4": { "Symfony\\Component\\ErrorCatcher\\": "" },
"exclude-from-classmap": [
"/Tests/"
]

View File

@ -13,7 +13,7 @@
</php>
<testsuites>
<testsuite name="Symfony ErrorHandler Component Test Suite">
<testsuite name="Symfony ErrorCatcher Component Test Suite">
<directory>./Tests/</directory>
</testsuite>
</testsuites>

View File

@ -1,5 +0,0 @@
<?php
class Symfony_Component_ErrorHandler_Tests_Fixtures_PEARClass
{
}

View File

@ -1,7 +0,0 @@
<?php
namespace Symfony\Component\ErrorHandler\Tests\Fixtures;
class UndefinedFuncException
{
}

View File

@ -1,7 +0,0 @@
<?php
namespace Symfony\Component\ErrorHandler\Tests\Fixtures2;
class RequiredTwice
{
}

View File

@ -11,7 +11,7 @@
namespace Symfony\Component\HttpKernel\DataCollector;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

View File

@ -11,7 +11,7 @@
namespace Symfony\Component\HttpKernel\DataCollector;
use Symfony\Component\ErrorHandler\Exception\SilencedErrorContext;
use Symfony\Component\ErrorCatcher\Exception\SilencedErrorContext;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Response;

View File

@ -15,11 +15,11 @@ use Psr\Log\LoggerInterface;
use Symfony\Component\Console\ConsoleEvents;
use Symfony\Component\Console\Event\ConsoleEvent;
use Symfony\Component\Console\Output\ConsoleOutputInterface;
use Symfony\Component\ErrorHandler\ErrorHandler;
use Symfony\Component\ErrorHandler\ErrorRenderer\ErrorRenderer;
use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;
use Symfony\Component\ErrorHandler\Exception\ErrorRendererNotFoundException;
use Symfony\Component\ErrorHandler\ExceptionHandler;
use Symfony\Component\ErrorCatcher\ErrorHandler;
use Symfony\Component\ErrorCatcher\ErrorRenderer\ErrorRenderer;
use Symfony\Component\ErrorCatcher\ErrorRenderer\HtmlErrorRenderer;
use Symfony\Component\ErrorCatcher\Exception\ErrorRendererNotFoundException;
use Symfony\Component\ErrorCatcher\ExceptionHandler;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Request;

View File

@ -12,7 +12,7 @@
namespace Symfony\Component\HttpKernel\EventListener;
use Psr\Log\LoggerInterface;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Request;

View File

@ -12,7 +12,7 @@
namespace Symfony\Component\HttpKernel\Tests\DataCollector;
use PHPUnit\Framework\TestCase;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\DataCollector\ExceptionDataCollector;

View File

@ -12,7 +12,7 @@
namespace Symfony\Component\HttpKernel\Tests\DataCollector;
use PHPUnit\Framework\TestCase;
use Symfony\Component\ErrorHandler\Exception\SilencedErrorContext;
use Symfony\Component\ErrorCatcher\Exception\SilencedErrorContext;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Response;
@ -106,7 +106,7 @@ class LoggerDataCollectorTest extends TestCase
$logs = array_map(function ($v) {
if (isset($v['context']['exception'])) {
$e = &$v['context']['exception'];
$e = isset($e["\0*\0message"]) ? [$e["\0*\0message"], $e["\0*\0severity"]] : [$e["\0Symfony\Component\ErrorHandler\Exception\SilencedErrorContext\0severity"]];
$e = isset($e["\0*\0message"]) ? [$e["\0*\0message"], $e["\0*\0severity"]] : [$e["\0Symfony\Component\ErrorCatcher\Exception\SilencedErrorContext\0severity"]];
}
return $v;

View File

@ -19,8 +19,8 @@ use Symfony\Component\Console\Event\ConsoleEvent;
use Symfony\Component\Console\Helper\HelperSet;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\ErrorHandler\ErrorHandler;
use Symfony\Component\ErrorHandler\ExceptionHandler;
use Symfony\Component\ErrorCatcher\ErrorHandler;
use Symfony\Component\ErrorCatcher\ExceptionHandler;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Event\KernelEvent;

View File

@ -17,10 +17,9 @@
],
"require": {
"php": "^7.1.3",
"symfony/error-handler": "^4.4",
"symfony/error-catcher": "^4.4|^5.0",
"symfony/event-dispatcher": "^4.3",
"symfony/http-foundation": "^4.4|^5.0",
"symfony/debug": "^4.4|^5.0",
"symfony/polyfill-ctype": "^1.8",
"symfony/polyfill-php73": "^1.9",
"psr/log": "~1.0"

View File

@ -11,7 +11,7 @@
namespace Symfony\Component\Messenger\EventListener;
use Psr\Log\LoggerInterface;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Messenger\Event\WorkerMessageFailedEvent;
use Symfony\Component\Messenger\Exception\HandlerFailedException;

View File

@ -11,7 +11,7 @@
namespace Symfony\Component\Messenger\Stamp;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
use Symfony\Component\Messenger\Envelope;
/**

Some files were not shown because too many files have changed in this diff Show More