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

ConditionsFacade   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 6
dl 0
loc 16
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A define() 0 3 1
A _call() 0 7 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