PhpReader::readRaw()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
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 10
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 2
    protected function readRaw(string $path)
13
    {
14 2
        $params = $this->builder->getVars()['params'] ?? [];
15
16 2
        $result = static function (array $params) {
17 2
            return require func_get_arg(1);
18 2
        };
19
20
        /** @psalm-suppress TooManyArguments */
21 2
        return $result($params, $path);
22
    }
23
}
24