ServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 16 2
1
<?php
2
3
namespace Moo\FlashCard;
4
5
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
6
use Moo\FlashCard\Command\CreateCard;
7
use Moo\FlashCard\Command\CreateCategory;
8
9
class ServiceProvider extends BaseServiceProvider
10
{
11
    /**
12
     * Bootstrap any application services.
13
     *
14
     * @return void
15
     */
16 15
    public function boot()
17
    {
18
        // Load database migration classes
19 15
        $this->loadMigrationsFrom(__DIR__ . '/../../database/migrations');
20
21
        // Load command line tool for add cards or categories
22 15
        if ($this->app->runningInConsole()) {
23 15
            $this->commands([
24 15
                CreateCard::class,
25
                CreateCategory::class,
26
            ]);
27
        }
28
29
        // Load API routes
30 15
        $this->loadRoutesFrom(__DIR__ . '/../../routes/api.php');
31 15
    }
32
}
33