Passed
Pull Request — master (#235)
by Evgeniy
09:21
created

dd()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 2
Bugs 1 Features 0
Metric Value
cc 2
eloc 3
c 2
b 1
f 0
nc 2
nop 1
dl 0
loc 6
ccs 0
cts 3
cp 0
crap 6
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
use Yiisoft\Files\FileHelper;
6
7
function shouldRebuildConfigs(): bool
8
{
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
}
20