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

ConditionsFacade::define()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
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