Test Failed
Push — router-extensions ( 3753c3...995b8d )
by Alex
02:50
created

Router::resource()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 3
eloc 6
nc 2
nop 3
1
<?php
2
3
namespace Huntie\JsonApi\Routing;
4
5
class Router extends \Illuminate\Routing\Router
6
{
7
    /**
8
     * Route a resource to a controller.
9
     *
10
     * @param string $name
11
     * @param string $controller
12
     * @param array  $options
13
     */
14
    public function resource($name, $controller, array $options = [])
15
    {
16
        if ($this->container && $this->container->bound(ResourceRegistrar::class)) {
17
            $registrar = $this->container->make(ResourceRegistrar::class);
18
        } else {
19
            $registrar = new ResourceRegistrar($this);
20
        }
21
22
        $registrar->register($name, $controller, $options);
23
    }
24
}
25