From 59e044dfb10e0c233ac22378195d19235fed986f Mon Sep 17 00:00:00 2001 From: Thomas Calvet Date: Tue, 12 Nov 2019 15:50:35 +0100 Subject: [PATCH] Allow \Throwable $previous everywhere --- .../Bundle/FrameworkBundle/Controller/ControllerTrait.php | 4 ++-- .../Exception/FileLoaderImportCircularReferenceException.php | 2 +- .../Config/Exception/FileLocatorFileNotFoundException.php | 2 +- .../Exception/AutowiringFailedException.php | 2 +- .../DependencyInjection/Exception/EnvParameterException.php | 2 +- .../Exception/ParameterCircularReferenceException.php | 2 +- .../Exception/ParameterNotFoundException.php | 4 ++-- .../Exception/ServiceCircularReferenceException.php | 2 +- .../Exception/ServiceNotFoundException.php | 2 +- src/Symfony/Component/Dotenv/Exception/FormatException.php | 2 +- src/Symfony/Component/Dotenv/Exception/PathException.php | 2 +- .../Component/Filesystem/Exception/FileNotFoundException.php | 2 +- src/Symfony/Component/Filesystem/Exception/IOException.php | 2 +- .../Component/Mailer/Exception/HttpTransportException.php | 2 +- .../Component/Routing/Exception/MethodNotAllowedException.php | 2 +- .../Security/Core/Exception/AccessDeniedException.php | 2 +- .../Exception/CustomUserMessageAuthenticationException.php | 2 +- .../Component/Security/Core/Exception/LogoutException.php | 2 +- .../Serializer/Exception/ExtraAttributesException.php | 2 +- .../Component/VarDumper/Exception/ThrowingCasterException.php | 4 ++-- src/Symfony/Component/Yaml/Exception/ParseException.php | 2 +- 21 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php b/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php index fd80fd47041a6..e5a1e109fa7b0 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php +++ b/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php @@ -288,7 +288,7 @@ protected function stream(string $view, array $parameters = [], StreamedResponse * * @final */ - protected function createNotFoundException(string $message = 'Not Found', \Exception $previous = null): NotFoundHttpException + protected function createNotFoundException(string $message = 'Not Found', \Throwable $previous = null): NotFoundHttpException { return new NotFoundHttpException($message, $previous); } @@ -304,7 +304,7 @@ protected function createNotFoundException(string $message = 'Not Found', \Excep * * @final */ - protected function createAccessDeniedException(string $message = 'Access Denied.', \Exception $previous = null): AccessDeniedException + protected function createAccessDeniedException(string $message = 'Access Denied.', \Throwable $previous = null): AccessDeniedException { if (!class_exists(AccessDeniedException::class)) { throw new \LogicException('You can not use the "createAccessDeniedException" method if the Security component is not available. Try running "composer require symfony/security-bundle".'); diff --git a/src/Symfony/Component/Config/Exception/FileLoaderImportCircularReferenceException.php b/src/Symfony/Component/Config/Exception/FileLoaderImportCircularReferenceException.php index da9105d0a5824..8c5e736524c75 100644 --- a/src/Symfony/Component/Config/Exception/FileLoaderImportCircularReferenceException.php +++ b/src/Symfony/Component/Config/Exception/FileLoaderImportCircularReferenceException.php @@ -18,7 +18,7 @@ */ class FileLoaderImportCircularReferenceException extends LoaderLoadException { - public function __construct(array $resources, int $code = null, \Exception $previous = null) + public function __construct(array $resources, int $code = null, \Throwable $previous = null) { $message = sprintf('Circular reference detected in "%s" ("%s" > "%s").', $this->varToString($resources[0]), implode('" > "', $resources), $resources[0]); diff --git a/src/Symfony/Component/Config/Exception/FileLocatorFileNotFoundException.php b/src/Symfony/Component/Config/Exception/FileLocatorFileNotFoundException.php index d8dad76a0a2c9..3ee4b938f417a 100644 --- a/src/Symfony/Component/Config/Exception/FileLocatorFileNotFoundException.php +++ b/src/Symfony/Component/Config/Exception/FileLocatorFileNotFoundException.php @@ -20,7 +20,7 @@ class FileLocatorFileNotFoundException extends \InvalidArgumentException { private $paths; - public function __construct(string $message = '', int $code = 0, \Exception $previous = null, array $paths = []) + public function __construct(string $message = '', int $code = 0, \Throwable $previous = null, array $paths = []) { parent::__construct($message, $code, $previous); diff --git a/src/Symfony/Component/DependencyInjection/Exception/AutowiringFailedException.php b/src/Symfony/Component/DependencyInjection/Exception/AutowiringFailedException.php index 99a5b17ccd044..c203b85baea20 100644 --- a/src/Symfony/Component/DependencyInjection/Exception/AutowiringFailedException.php +++ b/src/Symfony/Component/DependencyInjection/Exception/AutowiringFailedException.php @@ -19,7 +19,7 @@ class AutowiringFailedException extends RuntimeException private $serviceId; private $messageCallback; - public function __construct(string $serviceId, $message = '', int $code = 0, \Exception $previous = null) + public function __construct(string $serviceId, $message = '', int $code = 0, \Throwable $previous = null) { $this->serviceId = $serviceId; diff --git a/src/Symfony/Component/DependencyInjection/Exception/EnvParameterException.php b/src/Symfony/Component/DependencyInjection/Exception/EnvParameterException.php index c758ce143824a..48b5e486ae71d 100644 --- a/src/Symfony/Component/DependencyInjection/Exception/EnvParameterException.php +++ b/src/Symfony/Component/DependencyInjection/Exception/EnvParameterException.php @@ -18,7 +18,7 @@ */ class EnvParameterException extends InvalidArgumentException { - public function __construct(array $envs, \Exception $previous = null, string $message = 'Incompatible use of dynamic environment variables "%s" found in parameters.') + public function __construct(array $envs, \Throwable $previous = null, string $message = 'Incompatible use of dynamic environment variables "%s" found in parameters.') { parent::__construct(sprintf($message, implode('", "', $envs)), 0, $previous); } diff --git a/src/Symfony/Component/DependencyInjection/Exception/ParameterCircularReferenceException.php b/src/Symfony/Component/DependencyInjection/Exception/ParameterCircularReferenceException.php index e17e4024fdb4d..2450ccb5c797f 100644 --- a/src/Symfony/Component/DependencyInjection/Exception/ParameterCircularReferenceException.php +++ b/src/Symfony/Component/DependencyInjection/Exception/ParameterCircularReferenceException.php @@ -20,7 +20,7 @@ class ParameterCircularReferenceException extends RuntimeException { private $parameters; - public function __construct(array $parameters, \Exception $previous = null) + public function __construct(array $parameters, \Throwable $previous = null) { parent::__construct(sprintf('Circular reference detected for parameter "%s" ("%s" > "%s").', $parameters[0], implode('" > "', $parameters), $parameters[0]), 0, $previous); diff --git a/src/Symfony/Component/DependencyInjection/Exception/ParameterNotFoundException.php b/src/Symfony/Component/DependencyInjection/Exception/ParameterNotFoundException.php index 9fdc2fd775da3..7c0c5e3087a13 100644 --- a/src/Symfony/Component/DependencyInjection/Exception/ParameterNotFoundException.php +++ b/src/Symfony/Component/DependencyInjection/Exception/ParameterNotFoundException.php @@ -30,11 +30,11 @@ class ParameterNotFoundException extends InvalidArgumentException implements Not * @param string $key The requested parameter key * @param string $sourceId The service id that references the non-existent parameter * @param string $sourceKey The parameter key that references the non-existent parameter - * @param \Exception $previous The previous exception + * @param \Throwable $previous The previous exception * @param string[] $alternatives Some parameter name alternatives * @param string|null $nonNestedAlternative The alternative parameter name when the user expected dot notation for nested parameters */ - public function __construct(string $key, string $sourceId = null, string $sourceKey = null, \Exception $previous = null, array $alternatives = [], string $nonNestedAlternative = null) + public function __construct(string $key, string $sourceId = null, string $sourceKey = null, \Throwable $previous = null, array $alternatives = [], string $nonNestedAlternative = null) { $this->key = $key; $this->sourceId = $sourceId; diff --git a/src/Symfony/Component/DependencyInjection/Exception/ServiceCircularReferenceException.php b/src/Symfony/Component/DependencyInjection/Exception/ServiceCircularReferenceException.php index 5936b3a6d7944..a38671bcf24bd 100644 --- a/src/Symfony/Component/DependencyInjection/Exception/ServiceCircularReferenceException.php +++ b/src/Symfony/Component/DependencyInjection/Exception/ServiceCircularReferenceException.php @@ -21,7 +21,7 @@ class ServiceCircularReferenceException extends RuntimeException private $serviceId; private $path; - public function __construct(string $serviceId, array $path, \Exception $previous = null) + public function __construct(string $serviceId, array $path, \Throwable $previous = null) { parent::__construct(sprintf('Circular reference detected for service "%s", path: "%s".', $serviceId, implode(' -> ', $path)), 0, $previous); diff --git a/src/Symfony/Component/DependencyInjection/Exception/ServiceNotFoundException.php b/src/Symfony/Component/DependencyInjection/Exception/ServiceNotFoundException.php index 5c63aea062f3b..f91afae397d94 100644 --- a/src/Symfony/Component/DependencyInjection/Exception/ServiceNotFoundException.php +++ b/src/Symfony/Component/DependencyInjection/Exception/ServiceNotFoundException.php @@ -24,7 +24,7 @@ class ServiceNotFoundException extends InvalidArgumentException implements NotFo private $sourceId; private $alternatives; - public function __construct(string $id, string $sourceId = null, \Exception $previous = null, array $alternatives = [], string $msg = null) + public function __construct(string $id, string $sourceId = null, \Throwable $previous = null, array $alternatives = [], string $msg = null) { if (null !== $msg) { // no-op diff --git a/src/Symfony/Component/Dotenv/Exception/FormatException.php b/src/Symfony/Component/Dotenv/Exception/FormatException.php index adccc8c8d1298..3ac77e592d6a1 100644 --- a/src/Symfony/Component/Dotenv/Exception/FormatException.php +++ b/src/Symfony/Component/Dotenv/Exception/FormatException.php @@ -20,7 +20,7 @@ final class FormatException extends \LogicException implements ExceptionInterfac { private $context; - public function __construct(string $message, FormatExceptionContext $context, int $code = 0, \Exception $previous = null) + public function __construct(string $message, FormatExceptionContext $context, int $code = 0, \Throwable $previous = null) { $this->context = $context; diff --git a/src/Symfony/Component/Dotenv/Exception/PathException.php b/src/Symfony/Component/Dotenv/Exception/PathException.php index 6a82e94100ec1..4a4d71722223d 100644 --- a/src/Symfony/Component/Dotenv/Exception/PathException.php +++ b/src/Symfony/Component/Dotenv/Exception/PathException.php @@ -18,7 +18,7 @@ */ final class PathException extends \RuntimeException implements ExceptionInterface { - public function __construct(string $path, int $code = 0, \Exception $previous = null) + public function __construct(string $path, int $code = 0, \Throwable $previous = null) { parent::__construct(sprintf('Unable to read the "%s" environment file.', $path), $code, $previous); } diff --git a/src/Symfony/Component/Filesystem/Exception/FileNotFoundException.php b/src/Symfony/Component/Filesystem/Exception/FileNotFoundException.php index f941b536e7a22..48b6408095a13 100644 --- a/src/Symfony/Component/Filesystem/Exception/FileNotFoundException.php +++ b/src/Symfony/Component/Filesystem/Exception/FileNotFoundException.php @@ -19,7 +19,7 @@ */ class FileNotFoundException extends IOException { - public function __construct(string $message = null, int $code = 0, \Exception $previous = null, string $path = null) + public function __construct(string $message = null, int $code = 0, \Throwable $previous = null, string $path = null) { if (null === $message) { if (null === $path) { diff --git a/src/Symfony/Component/Filesystem/Exception/IOException.php b/src/Symfony/Component/Filesystem/Exception/IOException.php index f02cbd885cfca..fea26e4ddc40c 100644 --- a/src/Symfony/Component/Filesystem/Exception/IOException.php +++ b/src/Symfony/Component/Filesystem/Exception/IOException.php @@ -22,7 +22,7 @@ class IOException extends \RuntimeException implements IOExceptionInterface { private $path; - public function __construct(string $message, int $code = 0, \Exception $previous = null, string $path = null) + public function __construct(string $message, int $code = 0, \Throwable $previous = null, string $path = null) { $this->path = $path; diff --git a/src/Symfony/Component/Mailer/Exception/HttpTransportException.php b/src/Symfony/Component/Mailer/Exception/HttpTransportException.php index f9e49aaeda6e6..f672acc6f12b7 100644 --- a/src/Symfony/Component/Mailer/Exception/HttpTransportException.php +++ b/src/Symfony/Component/Mailer/Exception/HttpTransportException.php @@ -20,7 +20,7 @@ class HttpTransportException extends TransportException { private $response; - public function __construct(string $message = null, ResponseInterface $response, int $code = 0, \Exception $previous = null) + public function __construct(string $message = null, ResponseInterface $response, int $code = 0, \Throwable $previous = null) { parent::__construct($message, $code, $previous); diff --git a/src/Symfony/Component/Routing/Exception/MethodNotAllowedException.php b/src/Symfony/Component/Routing/Exception/MethodNotAllowedException.php index e129ec8bf2178..b897081bd5d84 100644 --- a/src/Symfony/Component/Routing/Exception/MethodNotAllowedException.php +++ b/src/Symfony/Component/Routing/Exception/MethodNotAllowedException.php @@ -22,7 +22,7 @@ class MethodNotAllowedException extends \RuntimeException implements ExceptionIn { protected $allowedMethods = []; - public function __construct(array $allowedMethods, string $message = null, int $code = 0, \Exception $previous = null) + public function __construct(array $allowedMethods, string $message = null, int $code = 0, \Throwable $previous = null) { $this->allowedMethods = array_map('strtoupper', $allowedMethods); diff --git a/src/Symfony/Component/Security/Core/Exception/AccessDeniedException.php b/src/Symfony/Component/Security/Core/Exception/AccessDeniedException.php index c8e7f7b8eeaa5..0e59dc4077a91 100644 --- a/src/Symfony/Component/Security/Core/Exception/AccessDeniedException.php +++ b/src/Symfony/Component/Security/Core/Exception/AccessDeniedException.php @@ -21,7 +21,7 @@ class AccessDeniedException extends RuntimeException private $attributes = []; private $subject; - public function __construct(string $message = 'Access Denied.', \Exception $previous = null) + public function __construct(string $message = 'Access Denied.', \Throwable $previous = null) { parent::__construct($message, 403, $previous); } diff --git a/src/Symfony/Component/Security/Core/Exception/CustomUserMessageAuthenticationException.php b/src/Symfony/Component/Security/Core/Exception/CustomUserMessageAuthenticationException.php index b64d267b4868c..203e8ba133dab 100644 --- a/src/Symfony/Component/Security/Core/Exception/CustomUserMessageAuthenticationException.php +++ b/src/Symfony/Component/Security/Core/Exception/CustomUserMessageAuthenticationException.php @@ -26,7 +26,7 @@ class CustomUserMessageAuthenticationException extends AuthenticationException private $messageData = []; - public function __construct(string $message = '', array $messageData = [], int $code = 0, \Exception $previous = null) + public function __construct(string $message = '', array $messageData = [], int $code = 0, \Throwable $previous = null) { parent::__construct($message, $code, $previous); diff --git a/src/Symfony/Component/Security/Core/Exception/LogoutException.php b/src/Symfony/Component/Security/Core/Exception/LogoutException.php index cd9e5b2268962..7058c6244b272 100644 --- a/src/Symfony/Component/Security/Core/Exception/LogoutException.php +++ b/src/Symfony/Component/Security/Core/Exception/LogoutException.php @@ -18,7 +18,7 @@ */ class LogoutException extends RuntimeException { - public function __construct(string $message = 'Logout Exception', \Exception $previous = null) + public function __construct(string $message = 'Logout Exception', \Throwable $previous = null) { parent::__construct($message, 403, $previous); } diff --git a/src/Symfony/Component/Serializer/Exception/ExtraAttributesException.php b/src/Symfony/Component/Serializer/Exception/ExtraAttributesException.php index 74d87f87f5e8d..b8fb86beef37e 100644 --- a/src/Symfony/Component/Serializer/Exception/ExtraAttributesException.php +++ b/src/Symfony/Component/Serializer/Exception/ExtraAttributesException.php @@ -20,7 +20,7 @@ class ExtraAttributesException extends RuntimeException { private $extraAttributes; - public function __construct(array $extraAttributes, \Exception $previous = null) + public function __construct(array $extraAttributes, \Throwable $previous = null) { $msg = sprintf('Extra attributes are not allowed ("%s" are unknown).', implode('", "', $extraAttributes)); diff --git a/src/Symfony/Component/VarDumper/Exception/ThrowingCasterException.php b/src/Symfony/Component/VarDumper/Exception/ThrowingCasterException.php index af47753ad5b69..122f0d358a129 100644 --- a/src/Symfony/Component/VarDumper/Exception/ThrowingCasterException.php +++ b/src/Symfony/Component/VarDumper/Exception/ThrowingCasterException.php @@ -17,9 +17,9 @@ class ThrowingCasterException extends \Exception { /** - * @param \Exception $prev The exception thrown from the caster + * @param \Throwable $prev The exception thrown from the caster */ - public function __construct(\Exception $prev) + public function __construct(\Throwable $prev) { parent::__construct('Unexpected '.\get_class($prev).' thrown from a caster: '.$prev->getMessage(), 0, $prev); } diff --git a/src/Symfony/Component/Yaml/Exception/ParseException.php b/src/Symfony/Component/Yaml/Exception/ParseException.php index 95efe68fbb8a1..ce623a3f9ab19 100644 --- a/src/Symfony/Component/Yaml/Exception/ParseException.php +++ b/src/Symfony/Component/Yaml/Exception/ParseException.php @@ -30,7 +30,7 @@ class ParseException extends RuntimeException * @param string|null $parsedFile The file name where the error occurred * @param \Exception|null $previous The previous exception */ - public function __construct(string $message, int $parsedLine = -1, string $snippet = null, string $parsedFile = null, \Exception $previous = null) + public function __construct(string $message, int $parsedLine = -1, string $snippet = null, string $parsedFile = null, \Throwable $previous = null) { $this->parsedFile = $parsedFile; $this->parsedLine = $parsedLine; pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy