1111use Symfony \Component \Console \Input \InputInterface ;
1212use Symfony \Component \Console \Output \OutputInterface ;
1313use Throwable ;
14- use Webmozart \Assert \Assert ;
1514
1615use function ErrorHeroModule \isExcludedException ;
1716
@@ -26,8 +25,6 @@ abstract class BaseLoggingCommand extends Command
2625
2726 private Logging $ logging ;
2827
29- private ?OutputInterface $ output = null ;
30-
3128 /**
3229 * MUST BE CALLED after __construct(), as service extends this base class may use depedendency injection
3330 *
@@ -41,18 +38,16 @@ public function init(array $errorHeroModuleConfig, Logging $logging): void
4138
4239 public function run (InputInterface $ input , OutputInterface $ output ): int
4340 {
44- $ this ->output = $ output ;
45-
4641 try {
4742 $ this ->phpError ();
4843 return parent ::run ($ input , $ output );
4944 } catch (Throwable $ throwable ) {
5045 }
5146
52- return $ this ->exceptionError ($ throwable );
47+ return $ this ->exceptionError ($ throwable, $ output );
5348 }
5449
55- private function exceptionError (Throwable $ throwable ): int
50+ private function exceptionError (Throwable $ throwable, OutputInterface $ output ): int
5651 {
5752 if (
5853 isset ($ this ->errorHeroModuleConfig [self ::DISPLAY_SETTINGS ]['exclude-exceptions ' ])
@@ -71,8 +66,7 @@ private function exceptionError(Throwable $throwable): int
7166 }
7267
7368 // show default view if display_errors setting = 0.
74- Assert::isInstanceOf ($ this ->output , OutputInterface::class);
75- return $ this ->showDefaultConsoleView ($ this ->output );
69+ return $ this ->showDefaultConsoleView ($ output );
7670 }
7771
7872 private function showDefaultConsoleView (OutputInterface $ output ): int
0 commit comments