BaseGroupOperator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A configure() 0 9 2
1
<?php
2
/**
3
 * @author Aleksandar Panic
4
 * @license http://www.apache.org/licenses/LICENSE-2.0
5
 * @since 1.0.0
6
 **/
7
8
namespace ArekX\ArrayExpression\Operators;
9
10
use ArekX\ArrayExpression\Interfaces\Operator;
11
12
abstract class BaseGroupOperator extends BaseOperator
13
{
14
    /**
15
     * Expression configuration
16
     *
17
     * @var array
18
     */
19
    protected $config = [];
20
21
    /**
22
     * List of instanced operators
23
     *
24
     * @var Operator[]
25
     */
26
    protected $operators = [];
27
28
    /**
29
     * @inheritDoc
30
     */
31 31
    public function configure(array $config)
32
    {
33 31
        $this->setName($config[0] ?? 'unknown');
34
35 31
        if (count($config) <= 1) {
36 4
            throw new \InvalidArgumentException("Minimum format must be satisfied: ['{$this->getName()}', <expression1>, ..., <expressionN>]");
37
        }
38
39 27
        $this->config = $config;
40
    }
41
}