Passed
Push — 1.0.0-alpha ( 268be3...1f7cc7 )
by Alex
02:54
created

RoutingServiceProvider::register()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace Huntie\JsonApi\Providers;
4
5
use Huntie\JsonApi\Routing\ResourceRegistrar;
6
use Huntie\JsonApi\Routing\Router;
7
use Illuminate\Support\ServiceProvider;
8
9
class RoutingServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Register the service provider.
13
     */
14
    public function register()
15
    {
16
        $this->app->singleton('router', function ($app) {
17
            return new Router($app['events'], $app);
18
        });
19
20
        $this->app->bind('Huntie\JsonApi\Routing\ResourceRegistrar', function ($app) {
21
            return new ResourceRegistrar($app['router']);
22
        });
23
    }
24
}
25