Skip to content
Permalink
Browse files

feature #32471 Add a new ErrorHandler component (mirror of the Debug …

…component) (yceruto)

This PR was squashed before being merged into the 4.4 branch (closes #32471).

Discussion
----------

Add a new ErrorHandler component (mirror of the Debug component)

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

On top of #32470

Commits
-------

b1b6e80 Add a new ErrorHandler component (mirror of the Debug component)
  • Loading branch information...
fabpot committed Jul 18, 2019
2 parents ba988ac + b1b6e80 commit 9ed1dd113c6a2f19b620343debd8081366caade0
Showing with 4,733 additions and 26 deletions.
  1. +6 −0 UPGRADE-4.4.md
  2. +5 −0 UPGRADE-5.0.md
  3. +8 −3 src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php
  4. +1 −1 src/Symfony/Bridge/PhpUnit/composer.json
  5. +1 −1 src/Symfony/Bundle/FrameworkBundle/Console/Application.php
  6. +1 −1 src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php
  7. +0 −1 src/Symfony/Bundle/FrameworkBundle/composer.json
  8. +4 −0 src/Symfony/Component/Debug/BufferingLogger.php
  9. +1 −0 src/Symfony/Component/Debug/CHANGELOG.md
  10. +4 −0 src/Symfony/Component/Debug/Debug.php
  11. +4 −0 src/Symfony/Component/Debug/DebugClassLoader.php
  12. +4 −0 src/Symfony/Component/Debug/ErrorHandler.php
  13. +4 −0 src/Symfony/Component/Debug/Exception/ClassNotFoundException.php
  14. +4 −0 src/Symfony/Component/Debug/Exception/FatalErrorException.php
  15. +4 −0 src/Symfony/Component/Debug/Exception/FatalThrowableError.php
  16. +1 −1 src/Symfony/Component/Debug/Exception/FlattenException.php
  17. +4 −0 src/Symfony/Component/Debug/Exception/OutOfMemoryException.php
  18. +4 −0 src/Symfony/Component/Debug/Exception/SilencedErrorContext.php
  19. +4 −0 src/Symfony/Component/Debug/Exception/UndefinedFunctionException.php
  20. +4 −0 src/Symfony/Component/Debug/Exception/UndefinedMethodException.php
  21. +4 −0 src/Symfony/Component/Debug/ExceptionHandler.php
  22. +4 −0 src/Symfony/Component/Debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php
  23. +4 −0 src/Symfony/Component/Debug/FatalErrorHandler/FatalErrorHandlerInterface.php
  24. +4 −0 src/Symfony/Component/Debug/FatalErrorHandler/UndefinedFunctionFatalErrorHandler.php
  25. +4 −0 src/Symfony/Component/Debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php
  26. +3 −0 src/Symfony/Component/Debug/Tests/DebugClassLoaderTest.php
  27. +2 −0 src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php
  28. +3 −0 src/Symfony/Component/Debug/Tests/ExceptionHandlerTest.php
  29. +7 −0 src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php
  30. +3 −0 src/Symfony/Component/Debug/Tests/FatalErrorHandler/UndefinedFunctionFatalErrorHandlerTest.php
  31. +3 −0 src/Symfony/Component/Debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php
  32. +1 −0 src/Symfony/Component/Debug/Tests/phpt/debug_class_loader.phpt
  33. +1 −0 src/Symfony/Component/Debug/Tests/phpt/decorate_exception_hander.phpt
  34. +1 −0 src/Symfony/Component/Debug/Tests/phpt/fatal_with_nested_handlers.phpt
  35. +3 −0 src/Symfony/Component/ErrorHandler/.gitignore
  36. +37 −0 src/Symfony/Component/ErrorHandler/BufferingLogger.php
  37. +7 −0 src/Symfony/Component/ErrorHandler/CHANGELOG.md
  38. +60 −0 src/Symfony/Component/ErrorHandler/Debug.php
  39. +525 −0 src/Symfony/Component/ErrorHandler/DebugClassLoader.php
  40. +715 −0 src/Symfony/Component/ErrorHandler/ErrorHandler.php
  41. +36 −0 src/Symfony/Component/ErrorHandler/Exception/ClassNotFoundException.php
  42. +77 −0 src/Symfony/Component/ErrorHandler/Exception/FatalErrorException.php
  43. +51 −0 src/Symfony/Component/ErrorHandler/Exception/FatalThrowableError.php
  44. +21 −0 src/Symfony/Component/ErrorHandler/Exception/OutOfMemoryException.php
  45. +67 −0 src/Symfony/Component/ErrorHandler/Exception/SilencedErrorContext.php
  46. +36 −0 src/Symfony/Component/ErrorHandler/Exception/UndefinedFunctionException.php
  47. +36 −0 src/Symfony/Component/ErrorHandler/Exception/UndefinedMethodException.php
  48. +187 −0 src/Symfony/Component/ErrorHandler/ExceptionHandler.php
  49. +193 −0 src/Symfony/Component/ErrorHandler/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php
  50. +32 −0 src/Symfony/Component/ErrorHandler/FatalErrorHandler/FatalErrorHandlerInterface.php
  51. +84 −0 src/Symfony/Component/ErrorHandler/FatalErrorHandler/UndefinedFunctionFatalErrorHandler.php
  52. +66 −0 src/Symfony/Component/ErrorHandler/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php
  53. +19 −0 src/Symfony/Component/ErrorHandler/LICENSE
  54. +12 −0 src/Symfony/Component/ErrorHandler/README.md
  55. +448 −0 src/Symfony/Component/ErrorHandler/Tests/DebugClassLoaderTest.php
  56. +563 −0 src/Symfony/Component/ErrorHandler/Tests/ErrorHandlerTest.php
  57. +145 −0 src/Symfony/Component/ErrorHandler/Tests/ExceptionHandlerTest.php
  58. +180 −0 src/Symfony/Component/ErrorHandler/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php
  59. +81 −0 ...Symfony/Component/ErrorHandler/Tests/FatalErrorHandler/UndefinedFunctionFatalErrorHandlerTest.php
  60. +76 −0 src/Symfony/Component/ErrorHandler/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php
  61. +13 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/AnnotatedClass.php
  62. +3 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/ClassAlias.php
  63. +34 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/ClassWithAnnotatedParameters.php
  64. +11 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/DefinitionInEvaluatedCode.php
  65. +12 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/DeprecatedClass.php
  66. +12 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/DeprecatedInterface.php
  67. +22 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/ErrorHandlerThatUsesThePreviousOne.php
  68. +19 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/ExtendedFinalMethod.php
  69. +85 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/FinalClasses.php
  70. +26 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/FinalMethod.php
  71. +10 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/FinalMethod2Trait.php
  72. +27 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/InterfaceWithAnnotatedParameters.php
  73. +15 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/InternalClass.php
  74. +10 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/InternalInterface.php
  75. +10 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/InternalTrait.php
  76. +23 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/InternalTrait2.php
  77. +15 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/LoggerThatSetAnErrorHandler.php
  78. +7 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/NonDeprecatedInterface.php
  79. +5 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/PEARClass.php
  80. +32 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/SubClassWithAnnotatedParameters.php
  81. +3 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/Throwing.php
  82. +24 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/ToStringThrower.php
  83. +13 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/TraitWithAnnotatedParameters.php
  84. +13 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/TraitWithInternalMethod.php
  85. +11 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/VirtualClass.php
  86. +18 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/VirtualClassMagicCall.php
  87. +34 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/VirtualInterface.php
  88. +10 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/VirtualSubInterface.php
  89. +10 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/VirtualTrait.php
  90. +7 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/casemismatch.php
  91. +7 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/notPsr0Bis.php
  92. +7 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/psr4/Psr4CaseMismatch.php
  93. +7 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures/reallyNotPsr0.php
  94. +7 −0 src/Symfony/Component/ErrorHandler/Tests/Fixtures2/RequiredTwice.php
  95. +38 −0 src/Symfony/Component/ErrorHandler/Tests/HeaderMock.php
  96. +24 −0 src/Symfony/Component/ErrorHandler/Tests/MockExceptionHandler.php
  97. +27 −0 src/Symfony/Component/ErrorHandler/Tests/phpt/debug_class_loader.phpt
  98. +47 −0 src/Symfony/Component/ErrorHandler/Tests/phpt/decorate_exception_hander.phpt
  99. +35 −0 src/Symfony/Component/ErrorHandler/Tests/phpt/exception_rethrown.phpt
  100. +42 −0 src/Symfony/Component/ErrorHandler/Tests/phpt/fatal_with_nested_handlers.phpt
  101. +41 −0 src/Symfony/Component/ErrorHandler/composer.json
  102. +33 −0 src/Symfony/Component/ErrorHandler/phpunit.xml.dist
  103. +1 −1 src/Symfony/Component/ErrorRenderer/Exception/FlattenException.php
  104. +1 −1 src/Symfony/Component/ErrorRenderer/Tests/Exception/FlattenExceptionTest.php
  105. +0 −2 src/Symfony/Component/ErrorRenderer/composer.json
  106. +1 −1 src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php
  107. +1 −1 src/Symfony/Component/HttpKernel/DependencyInjection/AddAnnotatedClassesToCachePass.php
  108. +2 −2 src/Symfony/Component/HttpKernel/EventListener/DebugHandlersListener.php
  109. +1 −1 src/Symfony/Component/HttpKernel/Kernel.php
  110. +2 −2 src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php
  111. +2 −2 src/Symfony/Component/HttpKernel/Tests/EventListener/DebugHandlersListenerTest.php
  112. +1 −1 src/Symfony/Component/HttpKernel/composer.json
  113. +1 −2 src/Symfony/Component/Messenger/composer.json
  114. +1 −1 src/Symfony/Component/VarDumper/Caster/ExceptionCaster.php
  115. +1 −1 src/Symfony/Component/VarDumper/Cloner/AbstractCloner.php
@@ -6,6 +6,12 @@ Cache

* Added argument `$prefix` to `AdapterInterface::clear()`

Debug
-----

* Deprecated `FlattenException`, use the `FlattenException` of the `ErrorRenderer` component
* Deprecated the whole component in favor of `ErrorHandler` component

DependencyInjection
-------------------

@@ -51,6 +51,11 @@ Console
$processHelper->run($output, Process::fromShellCommandline('ls -l'));
```

Debug
-----

* Removed the component

DependencyInjection
-------------------

@@ -18,7 +18,8 @@
use PHPUnit\Util\Blacklist;
use Symfony\Bridge\PhpUnit\ClockMock;
use Symfony\Bridge\PhpUnit\DnsMock;
use Symfony\Component\Debug\DebugClassLoader;
use Symfony\Component\Debug\DebugClassLoader as LegacyDebugClassLoader;
use Symfony\Component\ErrorHandler\DebugClassLoader;
/**
* PHP 5.3 compatible trait-like shared implementation.
@@ -53,7 +54,7 @@ public function __construct(array $mockedNamespaces = array())
Blacklist::$blacklistedClassNames['\Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerTrait'] = 2;
}
$enableDebugClassLoader = class_exists('Symfony\Component\Debug\DebugClassLoader');
$enableDebugClassLoader = class_exists(DebugClassLoader::class) || class_exists(LegacyDebugClassLoader::class);
foreach ($mockedNamespaces as $type => $namespaces) {
if (!\is_array($namespaces)) {
@@ -74,7 +75,11 @@ public function __construct(array $mockedNamespaces = array())
}
}
if ($enableDebugClassLoader) {
DebugClassLoader::enable();
if (class_exists(DebugClassLoader::class)) {
DebugClassLoader::enable();
} else {
LegacyDebugClassLoader::enable();
}
}
if (self::$globallyEnabled) {
$this->state = -2;
@@ -21,7 +21,7 @@
"php": ">=5.5.9"
},
"suggest": {
"symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader"
"symfony/error-handler": "For tracking deprecated interfaces usages at runtime with DebugClassLoader"
},
"conflict": {
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0"
@@ -19,8 +19,8 @@
use Symfony\Component\Console\Output\ConsoleOutputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\Debug\Exception\FatalThrowableError;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\ErrorHandler\Exception\FatalThrowableError;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\HttpKernel\KernelInterface;
@@ -29,10 +29,10 @@
use Symfony\Component\Cache\DependencyInjection\CachePoolPrunerPass;
use Symfony\Component\Config\Resource\ClassExistenceResource;
use Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass;
use Symfony\Component\Debug\ErrorHandler;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\Compiler\RegisterReverseContainerPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\ErrorHandler\ErrorHandler;
use Symfony\Component\ErrorRenderer\DependencyInjection\ErrorRendererPass;
use Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass;
use Symfony\Component\Form\DependencyInjection\FormPass;
@@ -70,7 +70,6 @@
"symfony/asset": "<3.4",
"symfony/browser-kit": "<4.3",
"symfony/console": "<4.3",
"symfony/debug": "<4.4",
"symfony/dotenv": "<4.2",
"symfony/dom-crawler": "<4.3",
"symfony/form": "<4.3",
@@ -13,10 +13,14 @@
use Psr\Log\AbstractLogger;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', BufferingLogger::class, \Symfony\Component\ErrorHandler\BufferingLogger::class), E_USER_DEPRECATED);
/**
* A buffering logger that stacks logs for later.
*
* @author Nicolas Grekas <p@tchwork.com>
*
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\BufferingLogger instead.
*/
class BufferingLogger extends AbstractLogger
{
@@ -5,6 +5,7 @@ CHANGELOG
-----

* deprecated `FlattenException`, use the `FlattenException` of the `ErrorRenderer` component
* deprecated the whole component in favor of the `ErrorHandler` component

4.3.0
-----
@@ -11,10 +11,14 @@
namespace Symfony\Component\Debug;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', Debug::class, \Symfony\Component\ErrorHandler\Debug::class), E_USER_DEPRECATED);
/**
* Registers all the debug tools.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\Debug instead.
*/
class Debug
{
@@ -13,6 +13,8 @@
use PHPUnit\Framework\MockObject\Matcher\StatelessInvocation;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', DebugClassLoader::class, \Symfony\Component\ErrorHandler\DebugClassLoader::class), E_USER_DEPRECATED);
/**
* Autoloader checking if the class is really defined in the file found.
*
@@ -24,6 +26,8 @@
* @author Christophe Coevoet <stof@notk.org>
* @author Nicolas Grekas <p@tchwork.com>
* @author Guilhem Niot <guilhem.niot@gmail.com>
*
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\DebugClassLoader instead.
*/
class DebugClassLoader
{
@@ -23,6 +23,8 @@
use Symfony\Component\Debug\FatalErrorHandler\UndefinedFunctionFatalErrorHandler;
use Symfony\Component\Debug\FatalErrorHandler\UndefinedMethodFatalErrorHandler;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', ErrorHandler::class, \Symfony\Component\ErrorHandler\ErrorHandler::class), E_USER_DEPRECATED);
/**
* A generic ErrorHandler for the PHP engine.
*
@@ -47,6 +49,8 @@
* @author Grégoire Pineau <lyrixx@lyrixx.info>
*
* @final since Symfony 4.3
*
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\ErrorHandler instead.
*/
class ErrorHandler
{
@@ -11,10 +11,14 @@
namespace Symfony\Component\Debug\Exception;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', ClassNotFoundException::class, \Symfony\Component\ErrorHandler\Exception\ClassNotFoundException::class), E_USER_DEPRECATED);
/**
* Class (or Trait or Interface) Not Found Exception.
*
* @author Konstanton Myakshin <koc-dp@yandex.ru>
*
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\Exception\ClassNotFoundException instead.
*/
class ClassNotFoundException extends FatalErrorException
{
@@ -11,10 +11,14 @@
namespace Symfony\Component\Debug\Exception;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', FatalErrorException::class, \Symfony\Component\ErrorHandler\Exception\FatalErrorException::class), E_USER_DEPRECATED);
/**
* Fatal Error Exception.
*
* @author Konstanton Myakshin <koc-dp@yandex.ru>
*
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\Exception\FatalErrorException instead.
*/
class FatalErrorException extends \ErrorException
{
@@ -11,10 +11,14 @@
namespace Symfony\Component\Debug\Exception;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', FatalThrowableError::class, \Symfony\Component\ErrorHandler\Exception\FatalThrowableError::class), E_USER_DEPRECATED);
/**
* Fatal Throwable Error.
*
* @author Nicolas Grekas <p@tchwork.com>
*
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\Exception\FatalThrowableError instead.
*/
class FatalThrowableError extends FatalErrorException
{
@@ -14,7 +14,7 @@
use Symfony\Component\HttpFoundation\Exception\RequestExceptionInterface;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "Symfony\Component\ErrorRenderer\Exception\FlattenException" instead.', FlattenException::class), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', FlattenException::class, \Symfony\Component\ErrorRenderer\Exception\FlattenException::class), E_USER_DEPRECATED);
/**
* FlattenException wraps a PHP Error or Exception to be able to serialize it.
@@ -11,10 +11,14 @@
namespace Symfony\Component\Debug\Exception;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', OutOfMemoryException::class, \Symfony\Component\ErrorHandler\Exception\OutOfMemoryException::class), E_USER_DEPRECATED);
/**
* Out of memory exception.
*
* @author Nicolas Grekas <p@tchwork.com>
*
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\Exception\OutOfMemoryException instead.
*/
class OutOfMemoryException extends FatalErrorException
{
@@ -11,10 +11,14 @@
namespace Symfony\Component\Debug\Exception;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', SilencedErrorContext::class, \Symfony\Component\ErrorHandler\Exception\SilencedErrorContext::class), E_USER_DEPRECATED);
/**
* Data Object that represents a Silenced Error.
*
* @author Grégoire Pineau <lyrixx@lyrixx.info>
*
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\Exception\SilencedErrorContext instead.
*/
class SilencedErrorContext implements \JsonSerializable
{
@@ -11,10 +11,14 @@
namespace Symfony\Component\Debug\Exception;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', UndefinedFunctionException::class, \Symfony\Component\ErrorHandler\Exception\UndefinedFunctionException::class), E_USER_DEPRECATED);
/**
* Undefined Function Exception.
*
* @author Konstanton Myakshin <koc-dp@yandex.ru>
*
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\Exception\UndefinedFunctionException instead.
*/
class UndefinedFunctionException extends FatalErrorException
{
@@ -11,10 +11,14 @@
namespace Symfony\Component\Debug\Exception;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', UndefinedMethodException::class, \Symfony\Component\ErrorHandler\Exception\UndefinedMethodException::class), E_USER_DEPRECATED);
/**
* Undefined Method Exception.
*
* @author Grégoire Pineau <lyrixx@lyrixx.info>
*
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\Exception\UndefinedMethodException instead.
*/
class UndefinedMethodException extends FatalErrorException
{
@@ -15,6 +15,8 @@
use Symfony\Component\Debug\Exception\OutOfMemoryException;
use Symfony\Component\HttpKernel\Debug\FileLinkFormatter;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', ExceptionHandler::class, \Symfony\Component\ErrorHandler\ExceptionHandler::class), E_USER_DEPRECATED);
/**
* ExceptionHandler converts an exception to a Response object.
*
@@ -28,6 +30,8 @@
* @author Nicolas Grekas <p@tchwork.com>
*
* @final since Symfony 4.3
*
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\ExceptionHandler instead.
*/
class ExceptionHandler
{
@@ -17,10 +17,14 @@
use Symfony\Component\Debug\Exception\ClassNotFoundException;
use Symfony\Component\Debug\Exception\FatalErrorException;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', ClassNotFoundFatalErrorHandler::class, \Symfony\Component\ErrorHandler\FatalErrorHandler\ClassNotFoundFatalErrorHandler::class), E_USER_DEPRECATED);
/**
* ErrorHandler for classes that do not exist.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\FatalErrorHandler\ClassNotFoundFatalErrorHandler instead.
*/
class ClassNotFoundFatalErrorHandler implements FatalErrorHandlerInterface
{
@@ -13,10 +13,14 @@
use Symfony\Component\Debug\Exception\FatalErrorException;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', FatalErrorHandlerInterface::class, \Symfony\Component\ErrorHandler\FatalErrorHandler\FatalErrorHandlerInterface::class), E_USER_DEPRECATED);
/**
* Attempts to convert fatal errors to exceptions.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\FatalErrorHandler\FatalErrorHandlerInterface instead.
*/
interface FatalErrorHandlerInterface
{
@@ -14,10 +14,14 @@
use Symfony\Component\Debug\Exception\FatalErrorException;
use Symfony\Component\Debug\Exception\UndefinedFunctionException;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', UndefinedFunctionFatalErrorHandler::class, \Symfony\Component\ErrorHandler\FatalErrorHandler\UndefinedFunctionFatalErrorHandler::class), E_USER_DEPRECATED);
/**
* ErrorHandler for undefined functions.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\FatalErrorHandler\UndefinedFunctionFatalErrorHandler instead.
*/
class UndefinedFunctionFatalErrorHandler implements FatalErrorHandlerInterface
{
@@ -14,10 +14,14 @@
use Symfony\Component\Debug\Exception\FatalErrorException;
use Symfony\Component\Debug\Exception\UndefinedMethodException;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', UndefinedMethodFatalErrorHandler::class, \Symfony\Component\ErrorHandler\FatalErrorHandler\UndefinedMethodFatalErrorHandler::class), E_USER_DEPRECATED);
/**
* ErrorHandler for undefined methods.
*
* @author Grégoire Pineau <lyrixx@lyrixx.info>
*
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\FatalErrorHandler\UndefinedMethodFatalErrorHandler instead.
*/
class UndefinedMethodFatalErrorHandler implements FatalErrorHandlerInterface
{
@@ -14,6 +14,9 @@
use PHPUnit\Framework\TestCase;
use Symfony\Component\Debug\DebugClassLoader;
/**
* @group legacy
*/
class DebugClassLoaderTest extends TestCase
{
/**
@@ -25,6 +25,8 @@
*
* @author Robert Schönthal <seroscho@googlemail.com>
* @author Nicolas Grekas <p@tchwork.com>
*
* @group legacy
*/
class ErrorHandlerTest extends TestCase
{
@@ -19,6 +19,9 @@
require_once __DIR__.'/HeaderMock.php';
/**
* @group legacy
*/
class ExceptionHandlerTest extends TestCase
{
protected function setUp()

0 comments on commit 9ed1dd1

Please sign in to comment.
You can’t perform that action at this time.