Skip to content

Commit db14f3a

Browse files
committed
Remove \Throwable support deprecation layer
1 parent 9dd6064 commit db14f3a

File tree

26 files changed

+44
-111
lines changed

26 files changed

+44
-111
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/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/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: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818

1919
/**
2020
* @author Jérémy Romey <jeremy@free-agent.fr>
21+
*
22+
* @final
2123
*/
22-
final class HttpClientDataCollector extends DataCollector
24+
class HttpClientDataCollector extends DataCollector
2325
{
2426
/**
2527
* @var TraceableHttpClient[]
@@ -34,7 +36,7 @@ public function registerClient(string $name, TraceableHttpClient $client)
3436
/**
3537
* {@inheritdoc}
3638
*/
37-
public function collect(Request $request, Response $response, \Exception $exception = null)
39+
public function collect(Request $request, Response $response, \Throwable $exception = null)
3840
{
3941
$this->initData();
4042

src/Symfony/Component/HttpKernel/DataCollector/AjaxDataCollector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
*
2020
* @author Bart van den Burg <bart@burgov.nl>
2121
*
22-
* @final since Symfony 4.4
22+
* @final
2323
*/
2424
class AjaxDataCollector extends DataCollector
2525
{
26-
public function collect(Request $request, Response $response, \Exception $exception = null)
26+
public function collect(Request $request, Response $response, \Throwable $exception = null)
2727
{
2828
// all collecting is done client side
2929
}

src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php

Lines changed: 2 additions & 2 deletions
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 ConfigDataCollector extends DataCollector implements LateDataCollectorInterface
2626
{
@@ -46,7 +46,7 @@ public function setKernel(KernelInterface $kernel = null)
4646
/**
4747
* {@inheritdoc}
4848
*/
49-
public function collect(Request $request, Response $response, \Exception $exception = null)
49+
public function collect(Request $request, Response $response, \Throwable $exception = null)
5050
{
5151
$this->data = [
5252
'token' => $response->headers->get('X-Debug-Token'),

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