Completed
Push — master ( 6373f2...b930c3 )
by Dmitry
02:29
created

AbstractAttribute   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 15
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
getOperatorRules() 0 1 ?
A getRuleForOperator() 0 10 2
1
<?php
2
3
namespace hiapi\query\attributes;
4
5
abstract class AbstractAttribute implements AttributeInterface
6
{
7
    abstract protected function getOperatorRules();
8
9
    public function getRuleForOperator($operator)
10
    {
11
        $rules = $this->getOperatorRules();
12
13
        if (isset($rules[$operator])) {
14
            return $rules[$operator];
15
        }
16
17
        throw UnsupportedOperatorException::forOperator($operator);
18
    }
19
}
20