Passed
Pull Request — master (#100)
by
unknown
14:55
created

PhpReader   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 7
c 0
b 0
f 0
dl 0
loc 19
ccs 0
cts 7
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setParams() 0 3 1
A readRaw() 0 10 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 implements ReaderWithParamsInterface
11
{
12
    private $params = [];
13
14
    protected function readRaw(string $path)
15
    {
16
        $result = static function () {
17
            /** @noinspection NonSecureExtractUsageInspection */
18
            $params = func_get_arg(0) ;
19
20
            return require func_get_arg(1);
21
        };
22
23
        return $result($this->params, $path);
24
    }
25
26
    public function setParams(array $params): void
27
    {
28
        $this->params = $params;
29
    }
30
}
31