Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | public function loadCSR(InputInterface $input, OutputInterface $output) |
||
26 | { |
||
27 | $csrFile = $input->getArgument('csr'); |
||
28 | if (!file_exists($csrFile)) { |
||
29 | $output->writeln('<error>Unable to load '. $csrFile .'</error>'); |
||
30 | $output->writeln('<error>Please check the path and try again</error>'); |
||
31 | |||
32 | exit(); |
||
1 ignored issue
–
show
|
|||
33 | } |
||
34 | |||
35 | return file_get_contents($csrFile); |
||
36 | } |
||
37 | } |
||
38 |
An exit expression should only be used in rare cases. For example, if you write a short command line script.
In most cases however, using an
exit
expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.