Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 5 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
46 | public function update(OutputStyle $output): void |
||
47 | { |
||
48 | $result = $this->updater->update(); |
||
49 | |||
50 | if ($result) { |
||
51 | $output->success(sprintf('Updated from version %s to %s.', $this->updater->getOldVersion(), |
||
52 | $this->updater->getNewVersion())); |
||
53 | exit(0); |
||
|
|||
54 | } elseif (! $this->updater->getNewVersion()) { |
||
55 | $output->success('There are no stable versions available.'); |
||
56 | } else { |
||
57 | $output->success('You have the latest version installed.'); |
||
58 | } |
||
61 |
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.