Passed
Push — master ( 506468...810608 )
by Iman
09:59
created

ConditionsFacade::_call()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 2
1
<?php
2
3
namespace Imanghafoori\HeyMan\Conditions;
4
5
class ConditionsFacade
6
{
7
    private $methods = [];
8
9
    public function _call($method, $param)
10
    {
11
        if (isset($this->methods[$method])) {
12
            return app()->call($this->methods[$method], $param);
13
        }
14
15
        throw new \BadMethodCallException($method.' does not exists as a condition');
16
    }
17
18
    public function define($methodName, $callable)
19
    {
20
        $this->methods[$methodName] = $callable;
21
    }
22
}
23