ServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 43
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 3 1
B boot() 0 35 2
1
<?php
2
3
namespace App\Plugins\ServiceDesk;
4
5
class ServiceProvider extends \App\Plugins\ServiceProvider {
6
7
    public function register() {
8
        parent::register('ServiceDesk');
9
    }
10
11
    public function boot() {
12
        /**
13
         * Migrations
14
         */
15
        $path = __DIR__ . '/database/migrations';
16
        $this->publishes([
17
            $path => database_path('/migrations/test')
18
                ], 'migrations');
19
        
20
        
21
        /**
22
         * Views
23
         */
24
        
25
         $view_path = app_path().DIRECTORY_SEPARATOR.'Plugins'.DIRECTORY_SEPARATOR.'ServiceDesk'.DIRECTORY_SEPARATOR.'views';
26
         $this->loadViewsFrom($view_path, 'service');
27
        
28
        /**
29
         * Translation
30
         */
31
        $trans = app_path().DIRECTORY_SEPARATOR.'Plugins'.DIRECTORY_SEPARATOR.'ServiceDesk'.DIRECTORY_SEPARATOR.'lang';
32
        $this->loadTranslationsFrom($trans, 'service');
33
        $controller = new \App\Plugins\ServiceDesk\Controllers\ActivateController();
34
        $a = $controller->activate();
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $a is correct as $controller->activate() (which targets App\Plugins\ServiceDesk\...eController::activate()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
35
        
36
        $controller = new Controllers\ActivateController();
37
        $controller->activate();
38
        
39
        if (class_exists('Breadcrumbs')){
40
            require __DIR__ . '/breadcrumbs.php';
41
        }   
42
        
43
        parent::boot('ServiceDesk');
44
45
    }
46
47
}
48