Completed
Push — master ( 184560...9805df )
by ARCANEDEV
21s queued 18s
created

RouteRegistrar   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 44
ccs 5
cts 5
cp 1
c 0
b 0
f 0
rs 10
wmc 2
lcom 0
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __call() 0 6 1
A forwardCallToRouter() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arcanedev\Support\Routing;
6
7
use Arcanedev\Support\Routing\Concerns\RegistersRouteClasses;
8
use Illuminate\Contracts\Foundation\Application;
9
use Illuminate\Contracts\Routing\Registrar;
10
use Illuminate\Routing\Router;
11
use Illuminate\Support\Traits\ForwardsCalls;
12
13
/**
14
 * Class     RouteRegistrar
15
 *
16
 * @package  Arcanedev\Support\Routing
17
 * @author   ARCANEDEV <[email protected]>
18
 *
19
 * @method  \Illuminate\Routing\RouteRegistrar  bind(string $key, \Closure $binder)
20
 * @method  void                                map()
21
 * @method  void                                bindings()
22
 *
23
 * @mixin  \Illuminate\Routing\RouteRegistrar
24
 */
25
abstract class RouteRegistrar
26
{
27
    /* -----------------------------------------------------------------
28
     |  Traits
29
     | -----------------------------------------------------------------
30
     */
31
32
    use RegistersRouteClasses,
33
        ForwardsCalls;
34
35
    /* -----------------------------------------------------------------
36
     |  Other Methods
37
     | -----------------------------------------------------------------
38
     */
39
40
    /**
41
     * Pass dynamic methods onto the router instance.
42
     *
43
     * @param  string  $method
44
     * @param  array   $parameters
45
     *
46
     * @return mixed
47
     */
48 114
    public function __call($method, $parameters)
49
    {
50 114
        return $this->forwardCallToRouter(
51 114
            app(Router::class), $method, $parameters
52
        );
53
    }
54
55
    /**
56
     * Pass dynamic methods onto the router instance.
57
     *
58
     * @param  \Illuminate\Contracts\Routing\Registrar  $router
59
     * @param  string                                   $method
60
     * @param  array                                    $parameters
61
     *
62
     * @return mixed
63
     */
64 114
    protected function forwardCallToRouter(Registrar $router, $method, $parameters)
65
    {
66 114
        return $this->forwardCallTo($router, $method, $parameters);
67
    }
68
}
69