Passed
Pull Request — master (#99)
by Evgeniy
05:38
created

FilePHP::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 7
ccs 4
cts 4
cp 1
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cekta\DI\Provider;
6
7
use InvalidArgumentException;
8
9
class FilePHP extends KeyValue
10
{
11 9
    public function __construct(string $path)
12
    {
13 9
        if (!file_exists($path)) {
14 3
            throw new InvalidArgumentException("invalid path: `$path`");
15
        }
16
        /** @noinspection PhpIncludeInspection */
17 9
        parent::__construct(require $path);
18 9
    }
19
}
20