Completed
Push — master ( b015a1...0e1003 )
by Abdelrahman
49:45
created

LarouteServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 1
lcom 1
cbo 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A registerCommand() 0 15 1
1
<?php
2
3
/*
4
 * NOTICE OF LICENSE
5
 *
6
 * Part of the Cortex Foundation Module.
7
 *
8
 * This source file is subject to The MIT License (MIT)
9
 * that is bundled with this package in the LICENSE file.
10
 *
11
 * Package: Cortex Foundation Module
12
 * License: The MIT License (MIT)
13
 * Link:    https://rinvex.com
14
 */
15
16
declare(strict_types=1);
17
18
namespace Cortex\Foundation\Overrides\Lord\Laroute;
19
20
use Lord\Laroute\Console\Commands\LarouteGeneratorCommand;
21
use Cortex\Foundation\Overrides\Lord\Laroute\Routes\Collection;
22
use Lord\Laroute\LarouteServiceProvider as BaseLarouteServiceProvider;
23
24
class LarouteServiceProvider extends BaseLarouteServiceProvider
25
{
26
    /**
27
     * Register the command.
28
     *
29
     * @return void
30
     */
31
    protected function registerCommand()
32
    {
33
        $this->app->singleton(
34
            'command.laroute.generate',
35
            function ($app) {
36
                $config = $app['config'];
37
                $routes = new Collection($app['router']->getRoutes(), $config->get('laroute.filter', 'all'), $config->get('laroute.action_namespace', ''));
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 155 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
38
                $generator = $app->make('Lord\Laroute\Generators\GeneratorInterface');
39
40
                return new LarouteGeneratorCommand($config, $routes, $generator);
41
            }
42
        );
43
44
        $this->commands('command.laroute.generate');
45
    }
46
}
47