Passed
Push — master ( f5390f...ff2936 )
by Alexander
02:09
created

Constants::constantsRequired()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Composer\Config\Config;
6
7
/**
8
 * Defines class represents output configuration file with constant definitions.
9
 */
10
class Constants extends Config
11
{
12
    protected function loadFile(string $path): array
13
    {
14
        parent::loadFile($path);
15
        if (pathinfo($path, PATHINFO_EXTENSION) !== 'php') {
16
            return [];
17
        }
18
19
        return [$path];
20
    }
21
22 1
    public function buildRequires(): string
23
    {
24 1
        $res = [];
25 1
        foreach ($this->values as $path) {
26
            $res[] = "require_once '$path';";
27
        }
28
29 1
        return implode("\n", $res);
30
    }
31
32 1
    protected function constantsRequired(): bool
33
    {
34 1
        return false;
35
    }
36
37 1
    protected function paramsRequired(): bool
38
    {
39 1
        return false;
40
    }
41
}
42