ExpressionLanguage::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace PhpEarth\Stats;
4
5
use Symfony\Component\ExpressionLanguage\ExpressionLanguage as BaseExpressionLanguage;
6
use Symfony\Component\ExpressionLanguage\ParserCache\ParserCacheInterface;
7
use PhpEarth\Stats\ExpressionLanguage\StringExpressionLanguageProvider;
8
use PhpEarth\Stats\ExpressionLanguage\NumberExpressionLanguageProvider;
9
10
class ExpressionLanguage extends BaseExpressionLanguage
11
{
12
    public function __construct(ParserCacheInterface $parser = null, array $providers = [])
13
    {
14
        // prepend the default provider to let users override it easily
15
        array_unshift($providers, new NumberExpressionLanguageProvider(), new StringExpressionLanguageProvider());
16
17
        parent::__construct($parser, $providers);
0 ignored issues
show
Bug introduced by
It seems like $parser can also be of type Symfony\Component\Expres...he\ParserCacheInterface; however, parameter $cache of Symfony\Component\Expres...Language::__construct() does only seem to accept Psr\Cache\CacheItemPoolInterface, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

17
        parent::__construct(/** @scrutinizer ignore-type */ $parser, $providers);
Loading history...
18
    }
19
}
20