ItilServiceProvider::boot()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 17
Code Lines 10

Duplication

Lines 17
Ratio 100 %

Importance

Changes 0
Metric Value
cc 3
eloc 10
nc 4
nop 0
dl 17
loc 17
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace App\Itil;
4
5
use Illuminate\Support\ServiceProvider;
6
7 View Code Duplication
class ItilServiceProvider extends ServiceProvider {
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
8
9
    /**
10
     * Bootstrap the application events.
11
     *
12
     * @return void
13
     */
14
    public function boot() {
15
16
        $view_path = app_path() . DIRECTORY_SEPARATOR . 'Itil' . DIRECTORY_SEPARATOR . 'views';
17
        $this->loadViewsFrom($view_path, 'itil');
18
19
        $lang_path = app_path() . DIRECTORY_SEPARATOR . 'Itil' . DIRECTORY_SEPARATOR . 'lang';
20
        $this->loadTranslationsFrom($lang_path, "itil");
21
22
        if (isInstall()) {
23
            $controller = new Controllers\ActivateController();
24
            $controller->activate();
25
        }
26
27
        if (class_exists('Breadcrumbs')) {
28
            require __DIR__ . '/breadcrumbs.php';
29
        }
30
    }
31
32
    /**
33
     * Register the service provider.
34
     *
35
     * @return void
36
     */
37
    public function register()
38
    {
39
        // Add routes
40
        if (isInstall()) {
41
            $routes = app_path('/Itil/routes.php');
42
            if (file_exists($routes)) {
43
                require $routes;
44
            }
45
        }
46
    }
47
48
}
49