Skip to content

Commit d9dc1c0

Browse files
committed
Remove unneeded output property on BaseLoggingCommand
1 parent a721c2f commit d9dc1c0

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/Command/BaseLoggingCommand.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ abstract class BaseLoggingCommand extends Command
2626

2727
private Logging $logging;
2828

29-
private ?OutputInterface $output = null;
30-
3129
/**
3230
* MUST BE CALLED after __construct(), as service extends this base class may use depedendency injection
3331
*
@@ -41,18 +39,19 @@ public function init(array $errorHeroModuleConfig, Logging $logging): void
4139

4240
public function run(InputInterface $input, OutputInterface $output): int
4341
{
44-
$this->output = $output;
45-
4642
try {
4743
$this->phpError();
4844
return parent::run($input, $output);
4945
} catch (Throwable $throwable) {
5046
}
5147

52-
return $this->exceptionError($throwable);
48+
$this->exceptionError($throwable);
49+
50+
// show default view if display_errors setting = 0.
51+
return $this->showDefaultConsoleView($output);
5352
}
5453

55-
private function exceptionError(Throwable $throwable): int
54+
private function exceptionError(Throwable $throwable): void
5655
{
5756
if (
5857
isset($this->errorHeroModuleConfig[self::DISPLAY_SETTINGS]['exclude-exceptions'])
@@ -69,10 +68,6 @@ private function exceptionError(Throwable $throwable): int
6968
if ($this->errorHeroModuleConfig[self::DISPLAY_SETTINGS]['display_errors']) {
7069
throw $throwable;
7170
}
72-
73-
// show default view if display_errors setting = 0.
74-
Assert::isInstanceOf($this->output, OutputInterface::class);
75-
return $this->showDefaultConsoleView($this->output);
7671
}
7772

7873
private function showDefaultConsoleView(OutputInterface $output): int

0 commit comments

Comments
 (0)