Skip to content

Commit 2326b80

Browse files
chalasrRobin Chalas
authored andcommitted
[Debug] Drop compatibility layers
1 parent 1126fa6 commit 2326b80

File tree

3 files changed

+4
-23
lines changed

3 files changed

+4
-23
lines changed

src/Symfony/Bridge/ProxyManager/Legacy/ProxiedMethodReturnExpression.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
use Composer\Autoload\ClassLoader;
1414
use ProxyManager\Version;
15+
use Symfony\Component\ErrorHandler\DebugClassLoader;
1516

1617
if (class_exists(Version::class) && version_compare(\defined(Version::class.'::VERSION') ? Version::VERSION : Version::getVersion(), '2.5', '<')) {
1718
/**
@@ -51,10 +52,7 @@ public static function generate(string $returnedValueExpression, ?\ReflectionMet
5152
if ($functionLoader instanceof ClassLoader) {
5253
return $functionLoader;
5354
}
54-
if ($functionLoader instanceof \Symfony\Component\Debug\DebugClassLoader) {
55-
return $getComposerClassLoader($functionLoader->getClassLoader());
56-
}
57-
if ($functionLoader instanceof \Symfony\Component\ErrorHandler\DebugClassLoader) {
55+
if ($functionLoader instanceof DebugClassLoader) {
5856
return $getComposerClassLoader($functionLoader->getClassLoader());
5957
}
6058
};

src/Symfony/Component/Console/Application.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@
4141
use Symfony\Component\Console\Output\ConsoleOutputInterface;
4242
use Symfony\Component\Console\Output\OutputInterface;
4343
use Symfony\Component\Console\Style\SymfonyStyle;
44-
use Symfony\Component\Debug\ErrorHandler as LegacyErrorHandler;
45-
use Symfony\Component\Debug\Exception\FatalThrowableError as LegacyFatalThrowableError;
4644
use Symfony\Component\ErrorHandler\ErrorHandler;
4745
use Symfony\Component\ErrorHandler\Exception\FatalThrowableError;
4846
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@@ -124,7 +122,7 @@ public function run(InputInterface $input = null, OutputInterface $output = null
124122

125123
$renderException = function ($e) use ($output) {
126124
if (!$e instanceof \Exception) {
127-
$e = class_exists(FatalThrowableError::class) ? new FatalThrowableError($e) : (class_exists(LegacyFatalThrowableError::class) ? new LegacyFatalThrowableError($e) : new \ErrorException($e->getMessage(), $e->getCode(), E_ERROR, $e->getFile(), $e->getLine()));
125+
$e = class_exists(FatalThrowableError::class) ? new FatalThrowableError($e) : new \ErrorException($e->getMessage(), $e->getCode(), E_ERROR, $e->getFile(), $e->getLine());
128126
}
129127
if ($output instanceof ConsoleOutputInterface) {
130128
$this->renderException($e, $output->getErrorOutput());
@@ -134,7 +132,7 @@ public function run(InputInterface $input = null, OutputInterface $output = null
134132
};
135133
if ($phpHandler = set_exception_handler($renderException)) {
136134
restore_exception_handler();
137-
if (!\is_array($phpHandler) || (!$phpHandler[0] instanceof ErrorHandler && !$phpHandler[0] instanceof LegacyErrorHandler)) {
135+
if (!\is_array($phpHandler) || !$phpHandler[0] instanceof ErrorHandle)) {
138136
$errorHandler = true;
139137
} elseif ($errorHandler = $phpHandler[0]->setExceptionHandler($renderException)) {
140138
$phpHandler[0]->setExceptionHandler($errorHandler);

src/Symfony/Component/ErrorRenderer/Exception/FlattenException.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -364,18 +364,3 @@ public function getAsString()
364364
return rtrim($message);
365365
}
366366
}
367-
368-
namespace Symfony\Component\Debug\Exception;
369-
370-
if (!class_exists(FlattenException::class, false)) {
371-
class_alias(\Symfony\Component\ErrorRenderer\Exception\FlattenException::class, FlattenException::class);
372-
}
373-
374-
if (false) {
375-
/**
376-
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorRenderer\Exception\FlattenException instead.
377-
*/
378-
class FlattenException extends \Symfony\Component\ErrorRenderer\Exception\FlattenException
379-
{
380-
}
381-
}

0 commit comments

Comments
 (0)