From 8ce3a89ac280e4fe7fc915c5be723962d66ee82a Mon Sep 17 00:00:00 2001 From: Thomas Calvet Date: Fri, 28 Jun 2019 16:30:36 +0200 Subject: [PATCH] [Debug] Remove all deprecated classes that were moved to the ErrorCatcher component --- .../Component/Debug/BufferingLogger.php | 41 ------------------- src/Symfony/Component/Debug/CHANGELOG.md | 9 +++- src/Symfony/Component/Debug/ErrorHandler.php | 23 ----------- .../Exception/ClassNotFoundException.php | 23 ----------- .../Debug/Exception/FatalErrorException.php | 23 ----------- .../Debug/Exception/FatalThrowableError.php | 23 ----------- .../Debug/Exception/FlattenException.php | 32 --------------- .../Debug/Exception/OutOfMemoryException.php | 23 ----------- .../Debug/Exception/SilencedErrorContext.php | 23 ----------- .../Exception/UndefinedFunctionException.php | 23 ----------- .../Exception/UndefinedMethodException.php | 23 ----------- .../Component/Debug/ExceptionHandler.php | 23 ----------- .../ClassNotFoundFatalErrorHandler.php | 23 ----------- .../FatalErrorHandlerInterface.php | 23 ----------- .../UndefinedFunctionFatalErrorHandler.php | 23 ----------- .../UndefinedMethodFatalErrorHandler.php | 23 ----------- 16 files changed, 8 insertions(+), 373 deletions(-) delete mode 100644 src/Symfony/Component/Debug/BufferingLogger.php delete mode 100644 src/Symfony/Component/Debug/ErrorHandler.php delete mode 100644 src/Symfony/Component/Debug/Exception/ClassNotFoundException.php delete mode 100644 src/Symfony/Component/Debug/Exception/FatalErrorException.php delete mode 100644 src/Symfony/Component/Debug/Exception/FatalThrowableError.php delete mode 100644 src/Symfony/Component/Debug/Exception/FlattenException.php delete mode 100644 src/Symfony/Component/Debug/Exception/OutOfMemoryException.php delete mode 100644 src/Symfony/Component/Debug/Exception/SilencedErrorContext.php delete mode 100644 src/Symfony/Component/Debug/Exception/UndefinedFunctionException.php delete mode 100644 src/Symfony/Component/Debug/Exception/UndefinedMethodException.php delete mode 100644 src/Symfony/Component/Debug/ExceptionHandler.php delete mode 100644 src/Symfony/Component/Debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php delete mode 100644 src/Symfony/Component/Debug/FatalErrorHandler/FatalErrorHandlerInterface.php delete mode 100644 src/Symfony/Component/Debug/FatalErrorHandler/UndefinedFunctionFatalErrorHandler.php delete mode 100644 src/Symfony/Component/Debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php diff --git a/src/Symfony/Component/Debug/BufferingLogger.php b/src/Symfony/Component/Debug/BufferingLogger.php deleted file mode 100644 index 6f801c0ab3af..000000000000 --- a/src/Symfony/Component/Debug/BufferingLogger.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Debug; - -@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4 and will be removed in 5.0.', BufferingLogger::class), E_USER_DEPRECATED); - -use Psr\Log\AbstractLogger; - -/** - * A buffering logger that stacks logs for later. - * - * @author Nicolas Grekas - * - * @deprecated since Symfony 4.4 and will be removed in 5.0. - */ -class BufferingLogger extends AbstractLogger -{ - private $logs = []; - - public function log($level, $message, array $context = []) - { - $this->logs[] = [$level, $message, $context]; - } - - public function cleanLogs() - { - $logs = $this->logs; - $this->logs = []; - - return $logs; - } -} diff --git a/src/Symfony/Component/Debug/CHANGELOG.md b/src/Symfony/Component/Debug/CHANGELOG.md index 720e735921d2..963dc08d3d6f 100644 --- a/src/Symfony/Component/Debug/CHANGELOG.md +++ b/src/Symfony/Component/Debug/CHANGELOG.md @@ -4,7 +4,14 @@ CHANGELOG 5.0.0 ----- -* removed `FlattenException::setTraceFromException()` in favor of `setTraceFromThrowable()` +* removed the `BufferingLogger`, `ErrorHandler` and `ExceptionHandler` classes, + they have been moved to the `ErrorCatcher` component +* removed the `FatalErrorHandlerInterface`, `ClassNotFoundFatalErrorHandler`, + `UndefinedFunctionFatalErrorHandler` and `UndefinedMethodFatalErrorHandler` classes, + they have been moved to the `ErrorCatcher` component +* removed the `ClassNotFoundException`, `FatalErrorException`, `FatalThrowableError`, + `FlattenException`, `OutOfMemoryException`, `SilencedErrorContext`, `UndefinedFunctionException`, + and `UndefinedMethodException`, they have been moved to the `ErrorCatcher` component 4.4.0 ----- diff --git a/src/Symfony/Component/Debug/ErrorHandler.php b/src/Symfony/Component/Debug/ErrorHandler.php deleted file mode 100644 index 68c90c253d84..000000000000 --- a/src/Symfony/Component/Debug/ErrorHandler.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Debug; - -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\ErrorCatcher\ErrorHandler instead. - */ -class ErrorHandler extends BaseErrorHandler -{ -} diff --git a/src/Symfony/Component/Debug/Exception/ClassNotFoundException.php b/src/Symfony/Component/Debug/Exception/ClassNotFoundException.php deleted file mode 100644 index 4b42cc61e473..000000000000 --- a/src/Symfony/Component/Debug/Exception/ClassNotFoundException.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Debug\Exception; - -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\ErrorCatcher\Exception\ClassNotFoundException instead. - */ -class ClassNotFoundException extends BaseClassNotFoundException -{ -} diff --git a/src/Symfony/Component/Debug/Exception/FatalErrorException.php b/src/Symfony/Component/Debug/Exception/FatalErrorException.php deleted file mode 100644 index 09a156ad7a21..000000000000 --- a/src/Symfony/Component/Debug/Exception/FatalErrorException.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Debug\Exception; - -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\ErrorCatcher\Exception\FatalErrorException instead. - */ -class FatalErrorException extends BaseFatalErrorException -{ -} diff --git a/src/Symfony/Component/Debug/Exception/FatalThrowableError.php b/src/Symfony/Component/Debug/Exception/FatalThrowableError.php deleted file mode 100644 index 6046f1c7cba4..000000000000 --- a/src/Symfony/Component/Debug/Exception/FatalThrowableError.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Debug\Exception; - -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\ErrorCatcher\Exception\FatalThrowableError instead. - */ -class FatalThrowableError extends BaseFatalThrowableError -{ -} diff --git a/src/Symfony/Component/Debug/Exception/FlattenException.php b/src/Symfony/Component/Debug/Exception/FlattenException.php deleted file mode 100644 index 748e2c601186..000000000000 --- a/src/Symfony/Component/Debug/Exception/FlattenException.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Debug\Exception; - -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\ErrorCatcher\Exception\FlattenException instead. - */ -class FlattenException extends BaseFlattenException -{ - /** - * @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\Exception::createFromThrowable() instead. - */ - public static function create(\Exception $exception, $statusCode = null, array $headers = []): self - { - @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\Exception::createFromThrowable() instead.', __METHOD__), E_USER_DEPRECATED); - - return parent::createFromThrowable($exception, $statusCode, $headers); - } -} diff --git a/src/Symfony/Component/Debug/Exception/OutOfMemoryException.php b/src/Symfony/Component/Debug/Exception/OutOfMemoryException.php deleted file mode 100644 index 20eb18524287..000000000000 --- a/src/Symfony/Component/Debug/Exception/OutOfMemoryException.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Debug\Exception; - -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\ErrorCatcher\Exception\OutOfMemoryException instead. - */ -class OutOfMemoryException extends BaseOutOfMemoryException -{ -} diff --git a/src/Symfony/Component/Debug/Exception/SilencedErrorContext.php b/src/Symfony/Component/Debug/Exception/SilencedErrorContext.php deleted file mode 100644 index 2b8ddc2bcb4b..000000000000 --- a/src/Symfony/Component/Debug/Exception/SilencedErrorContext.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Debug\Exception; - -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\ErrorCatcher\Exception\SilencedErrorContext instead. - */ -class SilencedErrorContext extends BaseSilencedErrorContext -{ -} diff --git a/src/Symfony/Component/Debug/Exception/UndefinedFunctionException.php b/src/Symfony/Component/Debug/Exception/UndefinedFunctionException.php deleted file mode 100644 index 9d509338620f..000000000000 --- a/src/Symfony/Component/Debug/Exception/UndefinedFunctionException.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Debug\Exception; - -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\ErrorCatcher\Exception\UndefinedFunctionException instead. - */ -class UndefinedFunctionException extends BaseUndefinedFunctionException -{ -} diff --git a/src/Symfony/Component/Debug/Exception/UndefinedMethodException.php b/src/Symfony/Component/Debug/Exception/UndefinedMethodException.php deleted file mode 100644 index 0edba8324955..000000000000 --- a/src/Symfony/Component/Debug/Exception/UndefinedMethodException.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Debug\Exception; - -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\ErrorCatcher\Exception\UndefinedMethodException instead. - */ -class UndefinedMethodException extends BaseUndefinedMethodException -{ -} diff --git a/src/Symfony/Component/Debug/ExceptionHandler.php b/src/Symfony/Component/Debug/ExceptionHandler.php deleted file mode 100644 index d195319ddf13..000000000000 --- a/src/Symfony/Component/Debug/ExceptionHandler.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Debug; - -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\ErrorCatcher\ExceptionHandler instead. - */ -class ExceptionHandler extends BaseExceptionHandler -{ -} diff --git a/src/Symfony/Component/Debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php b/src/Symfony/Component/Debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php deleted file mode 100644 index e7f1285f9802..000000000000 --- a/src/Symfony/Component/Debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Debug\FatalErrorHandler; - -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\ErrorCatcher\FatalErrorHandler\ClassNotFoundFatalErrorHandler instead. - */ -class ClassNotFoundFatalErrorHandler extends BaseClassNotFoundFatalErrorHandler -{ -} diff --git a/src/Symfony/Component/Debug/FatalErrorHandler/FatalErrorHandlerInterface.php b/src/Symfony/Component/Debug/FatalErrorHandler/FatalErrorHandlerInterface.php deleted file mode 100644 index 701ebe764061..000000000000 --- a/src/Symfony/Component/Debug/FatalErrorHandler/FatalErrorHandlerInterface.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Debug\FatalErrorHandler; - -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\ErrorCatcher\FatalErrorHandler\FatalErrorHandlerInterface instead. - */ -interface FatalErrorHandlerInterface extends BaseFatalErrorHandlerInterface -{ -} diff --git a/src/Symfony/Component/Debug/FatalErrorHandler/UndefinedFunctionFatalErrorHandler.php b/src/Symfony/Component/Debug/FatalErrorHandler/UndefinedFunctionFatalErrorHandler.php deleted file mode 100644 index 51015368e0d8..000000000000 --- a/src/Symfony/Component/Debug/FatalErrorHandler/UndefinedFunctionFatalErrorHandler.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Debug\FatalErrorHandler; - -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\ErrorCatcher\FatalErrorHandler\UndefinedFunctionFatalErrorHandler instead. - */ -class UndefinedFunctionFatalErrorHandler extends BaseUndefinedFunctionFatalErrorHandler -{ -} diff --git a/src/Symfony/Component/Debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php b/src/Symfony/Component/Debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php deleted file mode 100644 index 9e9164e07f00..000000000000 --- a/src/Symfony/Component/Debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Debug\FatalErrorHandler; - -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\ErrorCatcher\FatalErrorHandler\UndefinedMethodFatalErrorHandler instead. - */ -class UndefinedMethodFatalErrorHandler extends BaseUndefinedMethodFatalErrorHandler -{ -}