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

d()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 2
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 4
ccs 0
cts 2
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