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

AbstractAttribute::getOperatorRules()

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
ccs 0
cts 0
cp 0
c 0
b 0
f 0
nc 1
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