Conditions | 2 |
Paths | 3 |
Total Lines | 25 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types = 1); |
||
16 | public static function postCreateProject() |
||
17 | { |
||
18 | try |
||
19 | { |
||
20 | $yaml = Yaml::parse( |
||
21 | file_get_contents( |
||
22 | dirname(dirname(dirname(dirname(__DIR__)))) . DIRECTORY_SEPARATOR . 'installer.yaml' |
||
23 | ) |
||
24 | ); |
||
25 | var_export($yaml); |
||
26 | die(); |
||
|
|||
27 | $app = new Application( |
||
28 | self::TITLE, |
||
29 | Versions::getVersion('api-clients/middleware-skeleton') |
||
30 | ); |
||
31 | $app->add(new Install(Install::COMMAND)); |
||
32 | $app->find(Install::COMMAND)->run(new ArgvInput([]), new ConsoleOutput()); |
||
33 | } |
||
34 | catch (Throwable $throwable) |
||
35 | { |
||
36 | echo get_class($throwable), ' thrown with message: ', $throwable->getMessage(), PHP_EOL; |
||
37 | echo $throwable->getTraceAsString(), PHP_EOL; |
||
38 | exit(1); |
||
39 | } |
||
40 | } |
||
41 | } |
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.