41
41
use Symfony \Component \Console \Output \ConsoleOutputInterface ;
42
42
use Symfony \Component \Console \Output \OutputInterface ;
43
43
use Symfony \Component \Console \Style \SymfonyStyle ;
44
- use Symfony \Component \Debug \ErrorHandler as LegacyErrorHandler ;
45
- use Symfony \Component \Debug \Exception \FatalThrowableError as LegacyFatalThrowableError ;
46
44
use Symfony \Component \ErrorHandler \ErrorHandler ;
47
45
use Symfony \Component \ErrorHandler \Exception \FatalThrowableError ;
48
46
use Symfony \Component \EventDispatcher \EventDispatcherInterface ;
@@ -124,7 +122,7 @@ public function run(InputInterface $input = null, OutputInterface $output = null
124
122
125
123
$ renderException = function ($ e ) use ($ output ) {
126
124
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 ());
128
126
}
129
127
if ($ output instanceof ConsoleOutputInterface) {
130
128
$ this ->renderException ($ e , $ output ->getErrorOutput ());
@@ -134,7 +132,7 @@ public function run(InputInterface $input = null, OutputInterface $output = null
134
132
};
135
133
if ($ phpHandler = set_exception_handler ($ renderException )) {
136
134
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 )) {
138
136
$ errorHandler = true ;
139
137
} elseif ($ errorHandler = $ phpHandler [0 ]->setExceptionHandler ($ renderException )) {
140
138
$ phpHandler [0 ]->setExceptionHandler ($ errorHandler );
0 commit comments