@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | EnvironmentInterface $env, |
| 49 | 49 | FinalizerInterface $finalizer, |
| 50 | 50 | ContainerInterface $container |
| 51 | - ) { |
|
| 51 | + ){ |
|
| 52 | 52 | $this->env = $env; |
| 53 | 53 | $this->finalizer = $finalizer; |
| 54 | 54 | $this->container = $container; |
@@ -79,13 +79,13 @@ discard block |
||
| 79 | 79 | /** @var Console $console */ |
| 80 | 80 | $console = $this->container->get(Console::class); |
| 81 | 81 | |
| 82 | - try { |
|
| 82 | + try{ |
|
| 83 | 83 | return $console->start($input ?? new ArgvInput(), $output); |
| 84 | - } catch (Throwable $e) { |
|
| 84 | + }catch (Throwable $e){ |
|
| 85 | 85 | $this->handleException($e, $output); |
| 86 | 86 | |
| 87 | 87 | return 255; |
| 88 | - } finally { |
|
| 88 | + }finally{ |
|
| 89 | 89 | $listener->disable(); |
| 90 | 90 | $this->finalizer->finalize(false); |
| 91 | 91 | } |
@@ -97,9 +97,9 @@ discard block |
||
| 97 | 97 | */ |
| 98 | 98 | protected function handleException(Throwable $e, OutputInterface $output): void |
| 99 | 99 | { |
| 100 | - try { |
|
| 100 | + try{ |
|
| 101 | 101 | $this->container->get(SnapshotterInterface::class)->register($e); |
| 102 | - } catch (Throwable | ContainerExceptionInterface $se) { |
|
| 102 | + }catch (Throwable | ContainerExceptionInterface $se){ |
|
| 103 | 103 | // no need to notify when unable to register an exception |
| 104 | 104 | } |
| 105 | 105 | |
@@ -114,11 +114,11 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | private function mapVerbosity(OutputInterface $output): int |
| 116 | 116 | { |
| 117 | - if ($output->isDebug()) { |
|
| 117 | + if ($output->isDebug()){ |
|
| 118 | 118 | return ConsoleHandler::VERBOSITY_DEBUG; |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | - if ($output->isVeryVerbose()) { |
|
| 121 | + if ($output->isVeryVerbose()){ |
|
| 122 | 122 | return ConsoleHandler::VERBOSITY_VERBOSE; |
| 123 | 123 | } |
| 124 | 124 | |
@@ -79,13 +79,18 @@ discard block |
||
| 79 | 79 | /** @var Console $console */ |
| 80 | 80 | $console = $this->container->get(Console::class); |
| 81 | 81 | |
| 82 | - try { |
|
| 82 | + try |
|
| 83 | + { |
|
| 83 | 84 | return $console->start($input ?? new ArgvInput(), $output); |
| 84 | - } catch (Throwable $e) { |
|
| 85 | + } |
|
| 86 | + catch (Throwable $e) |
|
| 87 | + { |
|
| 85 | 88 | $this->handleException($e, $output); |
| 86 | 89 | |
| 87 | 90 | return 255; |
| 88 | - } finally { |
|
| 91 | + } |
|
| 92 | + finally |
|
| 93 | + { |
|
| 89 | 94 | $listener->disable(); |
| 90 | 95 | $this->finalizer->finalize(false); |
| 91 | 96 | } |
@@ -97,9 +102,12 @@ discard block |
||
| 97 | 102 | */ |
| 98 | 103 | protected function handleException(Throwable $e, OutputInterface $output): void |
| 99 | 104 | { |
| 100 | - try { |
|
| 105 | + try |
|
| 106 | + { |
|
| 101 | 107 | $this->container->get(SnapshotterInterface::class)->register($e); |
| 102 | - } catch (Throwable | ContainerExceptionInterface $se) { |
|
| 108 | + } |
|
| 109 | + catch (Throwable | ContainerExceptionInterface $se) |
|
| 110 | + { |
|
| 103 | 111 | // no need to notify when unable to register an exception |
| 104 | 112 | } |
| 105 | 113 | |
@@ -114,11 +122,13 @@ discard block |
||
| 114 | 122 | */ |
| 115 | 123 | private function mapVerbosity(OutputInterface $output): int |
| 116 | 124 | { |
| 117 | - if ($output->isDebug()) { |
|
| 125 | + if ($output->isDebug()) |
|
| 126 | + { |
|
| 118 | 127 | return ConsoleHandler::VERBOSITY_DEBUG; |
| 119 | 128 | } |
| 120 | 129 | |
| 121 | - if ($output->isVeryVerbose()) { |
|
| 130 | + if ($output->isVeryVerbose()) |
|
| 131 | + { |
|
| 122 | 132 | return ConsoleHandler::VERBOSITY_VERBOSE; |
| 123 | 133 | } |
| 124 | 134 | |