ExpressionLanguage   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
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