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

Facade   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 80%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 20
ccs 4
cts 5
cp 0.8
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __callStatic() 0 9 2
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