Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2.0116 |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
8 | function shouldRebuildConfigs(): bool { |
||
9 | 10 | $sourceDirectory = dirname(__DIR__) . '/config/'; |
|
10 | 10 | $buildDirectory = dirname(__DIR__) . '/runtime/build/config/'; |
|
11 | |||
12 | 10 | if (FileHelper::isEmptyDirectory($buildDirectory)) { |
|
13 | return true; |
||
14 | } |
||
15 | |||
16 | 10 | $sourceTime = FileHelper::lastModifiedTime($sourceDirectory); |
|
17 | 10 | $buildTime = FileHelper::lastModifiedTime($buildDirectory); |
|
18 | 10 | return $buildTime < $sourceTime; |
|
19 | } |
||
39 |
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.