AppServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 91.67%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 29
ccs 11
cts 12
cp 0.9167
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 8 1
A register() 0 7 2
1
<?php
2
3
namespace App\Providers;
4
5
use App\Link;
6
use Barryvdh\Debugbar\ServiceProvider as DebugbarServiceProvider;
7
use Illuminate\Support\Facades\Route;
8
use Illuminate\Support\Facades\Schema;
9
use Illuminate\Support\ServiceProvider;
10
use Laravel\Dusk\DuskServiceProvider;
11
12
class AppServiceProvider extends ServiceProvider
13
{
14
    /**
15
     * Bootstrap any application services.
16
     *
17
     * @return void
18
     */
19 12
    public function boot()
20
    {
21 12
        Schema::defaultStringLength(191);
22
23 12
        Route::bind('link_hash', function ($hash = '') {
24
            return Link::where('hash', $hash)->first();
25 12
        });
26 12
    }
27
28
    /**
29
     * Register any application services.
30
     *
31
     * @return void
32
     */
33 12
    public function register()
34
    {
35 12
        if ($this->app->environment('local', 'testing')) {
36 12
            $this->app->register(DuskServiceProvider::class);
37 12
            $this->app->register(DebugbarServiceProvider::class);
38 6
        }
39 12
    }
40
}
41