Test Failed
Push — router-extensions ( ac0866...397db6 )
by Alex
04:46
created

Router   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A jsonApiResource() 0 10 3
1
<?php
2
3
namespace Huntie\JsonApi\Routing;
4
5
class Router extends \Illuminate\Routing\Router
6
{
7
    /**
8
     * Route a JSON API resource to a controller.
9
     *
10
     * @param string $name
11
     * @param string $controller
12
     * @param array  $options
13
     */
14
    public function jsonApiResource($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