Completed
Push — master ( d3e0a6...196cd2 )
by Iman
08:32
created

SituationsProxy::call()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 3
nc 3
nop 2
1
<?php
2
3
namespace Imanghafoori\HeyMan\Situations;
4
5
class SituationsProxy
6
{
7
    const situations = [
8
        RouteSituations::class,
9
        ViewSituations::class,
10
        EloquentSituations::class,
11
        EventSituations::class,
12
    ];
13
14
    public static function call($method, $args)
15
    {
16
        foreach (self::situations as $className) {
17
            if (method_exists($className, $method)) {
18
                return app($className)->$method(...$args);
19
            }
20
        }
21
    }
22
}