LaravelHttpsServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 32
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 4 1
A register() 0 6 1
1
<?php namespace Padosoft\Laravel\Https;
2
3
use Illuminate\Routing\Router;
4
use Illuminate\Support\ServiceProvider;
5
use Padosoft\Laravel\Https\Middleware\HttpsForceMiddleware;
6
7
class LaravelHttpsServiceProvider extends ServiceProvider
8
{
9
10
    /**
11
     * Indicates if loading of the provider is deferred.
12
     *
13
     * @var bool
14
     */
15
    protected $defer = false;
16
17
    /**
18
     * Bootstrap the application events.
19
     *
20
     * @param Router $router
21
     */
22
    public function boot(Router $router)
23
    {
24
        $router->middlewareGroup('HttpsForce', [HttpsForceMiddleware::class]);
25
    }
26
27
    /**
28
     * Register the service provider.
29
     *
30
     * @return void
31
     */
32
    public function register()
33
    {
34
        $configPath = __DIR__ . '/../config/config.php';
35
        $this->mergeConfigFrom($configPath, 'laravel-https');
36
        $this->publishes([$configPath => config_path('laravel-https.php')], 'laravel-https');
37
    }
38
}
39
40