Skip to content

Commit b0ac75e

Browse files
committed
Remove \Throwable support deprecation layer
1 parent 8e6cc01 commit b0ac75e

File tree

32 files changed

+62
-112
lines changed

32 files changed

+62
-112
lines changed

src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ public function addLogger(string $name, DebugStack $logger)
5252

5353
/**
5454
* {@inheritdoc}
55-
*
56-
* @param \Throwable|null $exception
5755
*/
58-
public function collect(Request $request, Response $response/*, \Throwable $exception = null*/)
56+
public function collect(Request $request, Response $response, \Throwable $exception = null)
5957
{
6058
$queries = [];
6159
foreach ($this->loggers as $name => $logger) {

src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
* @author Fabien Potencier <fabien@symfony.com>
2828
*
29-
* @final since Symfony 4.4
29+
* @final
3030
*/
3131
class TwigDataCollector extends DataCollector implements LateDataCollectorInterface
3232
{
@@ -43,7 +43,7 @@ public function __construct(Profile $profile, Environment $twig = null)
4343
/**
4444
* {@inheritdoc}
4545
*/
46-
public function collect(Request $request, Response $response, \Exception $exception = null)
46+
public function collect(Request $request, Response $response, \Throwable $exception = null)
4747
{
4848
}
4949

src/Symfony/Bridge/Twig/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"symfony/console": "<4.4",
5252
"symfony/form": "<5.0",
5353
"symfony/http-foundation": "<4.4",
54+
"symfony/http-kernel": "<4.4",
5455
"symfony/translation": "<5.0",
5556
"symfony/workflow": "<4.4"
5657
},

src/Symfony/Bundle/FrameworkBundle/DataCollector/RouterDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*
2121
* @author Fabien Potencier <fabien@symfony.com>
2222
*
23-
* @final since Symfony 4.4
23+
* @final
2424
*/
2525
class RouterDataCollector extends BaseRouterDataCollector
2626
{

src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
/**
3434
* @author Fabien Potencier <fabien@symfony.com>
3535
*
36-
* @final since Symfony 4.4
36+
* @final
3737
*/
3838
class SecurityDataCollector extends DataCollector implements LateDataCollectorInterface
3939
{
@@ -59,7 +59,7 @@ public function __construct(TokenStorageInterface $tokenStorage = null, RoleHier
5959
/**
6060
* {@inheritdoc}
6161
*/
62-
public function collect(Request $request, Response $response, \Exception $exception = null)
62+
public function collect(Request $request, Response $response, \Throwable $exception = null)
6363
{
6464
if (null === $this->tokenStorage) {
6565
$this->data = [

src/Symfony/Component/Cache/DataCollector/CacheDataCollector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* @author Aaron Scherer <aequasi@gmail.com>
2323
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
2424
*
25-
* @final since Symfony 4.4
25+
* @final
2626
*/
2727
class CacheDataCollector extends DataCollector implements LateDataCollectorInterface
2828
{
@@ -39,7 +39,7 @@ public function addInstance(string $name, TraceableAdapter $instance)
3939
/**
4040
* {@inheritdoc}
4141
*/
42-
public function collect(Request $request, Response $response, \Exception $exception = null)
42+
public function collect(Request $request, Response $response, \Throwable $exception = null)
4343
{
4444
$empty = ['calls' => [], 'config' => [], 'options' => [], 'statistics' => []];
4545
$this->data = ['instances' => $empty, 'total' => $empty];

src/Symfony/Component/Cache/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
"conflict": {
4242
"doctrine/dbal": "<2.5",
4343
"symfony/dependency-injection": "<4.4",
44-
"symfony/var-dumper": "<4.4"
44+
"symfony/var-dumper": "<4.4",
45+
"symfony/http-kernel": "<4.4"
4546
},
4647
"autoload": {
4748
"psr-4": { "Symfony\\Component\\Cache\\": "" },

src/Symfony/Component/Console/Application.php

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
use Symfony\Component\Console\Output\OutputInterface;
4343
use Symfony\Component\Console\Style\SymfonyStyle;
4444
use Symfony\Component\ErrorHandler\ErrorHandler;
45-
use Symfony\Component\ErrorHandler\Exception\ErrorException;
4645
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
4746
use Symfony\Contracts\Service\ResetInterface;
4847

@@ -758,79 +757,19 @@ public static function getAbbreviations(array $names)
758757
return $abbrevs;
759758
}
760759

761-
/**
762-
* Renders a caught exception.
763-
*
764-
* @deprecated since Symfony 4.4, use "renderThrowable()" instead
765-
*/
766-
public function renderException(\Exception $e, OutputInterface $output)
767-
{
768-
@trigger_error(sprintf('The "%s::renderException()" method is deprecated since Symfony 4.4, use "renderThrowable()" instead.', __CLASS__), E_USER_DEPRECATED);
769-
770-
$output->writeln('', OutputInterface::VERBOSITY_QUIET);
771-
772-
$this->doRenderException($e, $output);
773-
774-
$this->finishRenderThrowableOrException($output);
775-
}
776-
777760
public function renderThrowable(\Throwable $e, OutputInterface $output): void
778761
{
779-
if (__CLASS__ !== \get_class($this) && __CLASS__ === (new \ReflectionMethod($this, 'renderThrowable'))->getDeclaringClass()->getName() && __CLASS__ !== (new \ReflectionMethod($this, 'renderException'))->getDeclaringClass()->getName()) {
780-
@trigger_error(sprintf('The "%s::renderException()" method is deprecated since Symfony 4.4, use "renderThrowable()" instead.', __CLASS__), E_USER_DEPRECATED);
781-
782-
if (!$e instanceof \Exception) {
783-
$e = class_exists(ErrorException::class) ? new ErrorException($e) : new \ErrorException($e->getMessage(), $e->getCode(), E_ERROR, $e->getFile(), $e->getLine());
784-
}
785-
786-
$this->renderException($e, $output);
787-
788-
return;
789-
}
790-
791762
$output->writeln('', OutputInterface::VERBOSITY_QUIET);
792763

793764
$this->doRenderThrowable($e, $output);
794765

795-
$this->finishRenderThrowableOrException($output);
796-
}
797-
798-
private function finishRenderThrowableOrException(OutputInterface $output): void
799-
{
800766
if (null !== $this->runningCommand) {
801767
$output->writeln(sprintf('<info>%s</info>', sprintf($this->runningCommand->getSynopsis(), $this->getName())), OutputInterface::VERBOSITY_QUIET);
802768
$output->writeln('', OutputInterface::VERBOSITY_QUIET);
803769
}
804770
}
805771

806-
/**
807-
* @deprecated since Symfony 4.4, use "doRenderThrowable()" instead
808-
*/
809-
protected function doRenderException(\Exception $e, OutputInterface $output)
810-
{
811-
@trigger_error(sprintf('The "%s::doRenderException()" method is deprecated since Symfony 4.4, use "doRenderThrowable()" instead.', __CLASS__), E_USER_DEPRECATED);
812-
813-
$this->doActuallyRenderThrowable($e, $output);
814-
}
815-
816772
protected function doRenderThrowable(\Throwable $e, OutputInterface $output): void
817-
{
818-
if (__CLASS__ !== \get_class($this) && __CLASS__ === (new \ReflectionMethod($this, 'doRenderThrowable'))->getDeclaringClass()->getName() && __CLASS__ !== (new \ReflectionMethod($this, 'doRenderException'))->getDeclaringClass()->getName()) {
819-
@trigger_error(sprintf('The "%s::doRenderException()" method is deprecated since Symfony 4.4, use "doRenderThrowable()" instead.', __CLASS__), E_USER_DEPRECATED);
820-
821-
if (!$e instanceof \Exception) {
822-
$e = class_exists(ErrorException::class) ? new ErrorException($e) : new \ErrorException($e->getMessage(), $e->getCode(), E_ERROR, $e->getFile(), $e->getLine());
823-
}
824-
825-
$this->doRenderException($e, $output);
826-
827-
return;
828-
}
829-
830-
$this->doActuallyRenderThrowable($e, $output);
831-
}
832-
833-
private function doActuallyRenderThrowable(\Throwable $e, OutputInterface $output): void
834773
{
835774
do {
836775
$message = trim($e->getMessage());

src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function __construct(FormDataExtractorInterface $dataExtractor)
8181
/**
8282
* Does nothing. The data is collected during the form event listeners.
8383
*/
84-
public function collect(Request $request, Response $response, \Exception $exception = null)
84+
public function collect(Request $request, Response $response, \Throwable $exception = null)
8585
{
8686
}
8787

src/Symfony/Component/HttpClient/DataCollector/HttpClientDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function registerClient(string $name, TraceableHttpClient $client)
3434
/**
3535
* {@inheritdoc}
3636
*/
37-
public function collect(Request $request, Response $response, \Exception $exception = null)
37+
public function collect(Request $request, Response $response, \Throwable $exception = null)
3838
{
3939
$this->initData();
4040

0 commit comments

Comments
 (0)
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