Passed
Pull Request — master (#7)
by Choraimy
02:56
created

Facade::__callStatic()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2.032

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 2
dl 0
loc 9
ccs 4
cts 5
cp 0.8
crap 2.032
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace LaraCrafts\GeoRoutes\Support;
4
5
use Illuminate\Support\Facades\Route;
6
use LaraCrafts\GeoRoutes\GeoRoute;
7
8
class Facade extends Route
9
{
10
    /**
11
     * Handle dynamic, static calls to the object.
12
     *
13
     * @param string $method
14
     * @param array $args
15
     * @return mixed
16
     *
17
     * @throws \RuntimeException
18
     */
19 3
    public static function __callStatic($method, $args)
20
    {
21 3
        $resolved = parent::__callStatic($method, $args);
22
23 3
        if (!$resolved instanceof \Illuminate\Routing\Route) {
24
            return $resolved;
25
        }
26
27 3
        return new GeoRoute($resolved, [], 'allow');
28
    }
29
}
30