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

PhpReader::readRaw()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 4
c 2
b 0
f 0
dl 0
loc 9
ccs 6
cts 6
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Composer\Config\Reader;
6
7
/**
8
 * PhpReader - reads PHP files.
9
 */
10
class PhpReader extends AbstractReader
11
{
12 1
    protected function readRaw(string $path)
13
    {
14 1
        $params = $this->builder->getVars()['params'] ?? [];
15
16 1
        $result = static function (array $params) {
17 1
            return require func_get_arg(1);
18 1
        };
19
20 1
        return $result($params, $path);
21
    }
22
}
23