Skip to content

Drop Debug compatibility layers #33027

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

use Composer\Autoload\ClassLoader;
use ProxyManager\Version;
use Symfony\Component\ErrorHandler\DebugClassLoader;

if (class_exists(Version::class) && version_compare(\defined(Version::class.'::VERSION') ? Version::VERSION : Version::getVersion(), '2.5', '<')) {
/**
Expand Down Expand Up @@ -51,10 +52,7 @@ public static function generate(string $returnedValueExpression, ?\ReflectionMet
if ($functionLoader instanceof ClassLoader) {
return $functionLoader;
}
if ($functionLoader instanceof \Symfony\Component\Debug\DebugClassLoader) {
return $getComposerClassLoader($functionLoader->getClassLoader());
}
if ($functionLoader instanceof \Symfony\Component\ErrorHandler\DebugClassLoader) {
if ($functionLoader instanceof DebugClassLoader) {
return $getComposerClassLoader($functionLoader->getClassLoader());
}
};
Expand Down
6 changes: 2 additions & 4 deletions src/Symfony/Component/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
use Symfony\Component\Console\Output\ConsoleOutputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\Debug\ErrorHandler as LegacyErrorHandler;
use Symfony\Component\Debug\Exception\FatalThrowableError as LegacyFatalThrowableError;
use Symfony\Component\ErrorHandler\ErrorHandler;
use Symfony\Component\ErrorHandler\Exception\FatalThrowableError;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
Expand Down Expand Up @@ -124,7 +122,7 @@ public function run(InputInterface $input = null, OutputInterface $output = null

$renderException = function ($e) use ($output) {
if (!$e instanceof \Exception) {
$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()));
$e = class_exists(FatalThrowableError::class) ? new FatalThrowableError($e) : new \ErrorException($e->getMessage(), $e->getCode(), E_ERROR, $e->getFile(), $e->getLine());
}
if ($output instanceof ConsoleOutputInterface) {
$this->renderException($e, $output->getErrorOutput());
Expand All @@ -134,7 +132,7 @@ public function run(InputInterface $input = null, OutputInterface $output = null
};
if ($phpHandler = set_exception_handler($renderException)) {
restore_exception_handler();
if (!\is_array($phpHandler) || (!$phpHandler[0] instanceof ErrorHandler && !$phpHandler[0] instanceof LegacyErrorHandler)) {
if (!\is_array($phpHandler) || !$phpHandler[0] instanceof ErrorHandle)) {
$errorHandler = true;
} elseif ($errorHandler = $phpHandler[0]->setExceptionHandler($renderException)) {
$phpHandler[0]->setExceptionHandler($errorHandler);
Expand Down
15 changes: 0 additions & 15 deletions src/Symfony/Component/ErrorRenderer/Exception/FlattenException.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,18 +364,3 @@ public function getAsString()
return rtrim($message);
}
}

namespace Symfony\Component\Debug\Exception;

if (!class_exists(FlattenException::class, false)) {
class_alias(\Symfony\Component\ErrorRenderer\Exception\FlattenException::class, FlattenException::class);
}

if (false) {
/**
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorRenderer\Exception\FlattenException instead.
*/
class FlattenException extends \Symfony\Component\ErrorRenderer\Exception\FlattenException
{
}
}