Passed
Push — master ( 62919d...1f65fa )
by Iman
04:23
created

CbStatisticsServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 35
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 2 1
A registerModule() 0 10 1
A boot() 0 7 1
1
<?php
2
3
namespace Crocodicstudio\Crudbooster\Modules\StatisticModule;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class CbStatisticsServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap the application services.
11
     *
12
     * @return void
13
     */
14
    public function boot()
15
    {
16
        $this->app['view']->addNamespace('CbStatistics', __DIR__.'/views');
17
        $this->loadRoutesFrom( __DIR__.'/statistic_route.php');
18
        $this->loadMigrationsFrom(__DIR__ . '/migrations');
19
        app('CbDynamicMenus')->addSuperAdminMenu('CbStatistics::menu');
0 ignored issues
show
Bug introduced by
The method addSuperAdminMenu() does not exist on Illuminate\Foundation\Application. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
        app('CbDynamicMenus')->/** @scrutinizer ignore-call */ addSuperAdminMenu('CbStatistics::menu');

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
20
        $this->registerModule();
21
    }
22
23
    /**
24
     * Register the application services.
25
     *
26
     * @return void
27
     */
28
    public function register()
29
    {
30
    }
31
32
    private function registerModule()
33
    {
34
        app('CbModulesRegistery')->addModule('statistic-builder', (object) [
0 ignored issues
show
Bug introduced by
The method addModule() does not exist on Illuminate\Foundation\Application. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

34
        app('CbModulesRegistery')->/** @scrutinizer ignore-call */ addModule('statistic-builder', (object) [

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
35
            'name' => trans('crudbooster.Statistic_Builder'),
36
            'icon' => 'fa fa-dashboard',
37
            'path' => 'statistic_builder',
38
            'table_name' => 'cms_statistics',
39
            'controller' => 'StatisticBuilderController',
40
            'is_protected' => 1,
41
            'is_active' => 1,
42
        ]);
43
    }
44
45
}
46