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

CbMenuServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 41
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 8 1
1
<?php
2
3
namespace Crocodicstudio\Crudbooster\Modules\MenuModule;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class CbMenuServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap the application services.
11
     *
12
     * @return void
13
     */
14
    public function boot()
15
    {
16
        $this->app['view']->addNamespace('CbMenu', __DIR__.'/views');
17
        $this->loadRoutesFrom( __DIR__.'/menus_routes.php');
18
        $this->loadMigrationsFrom(__DIR__ . '/migrations');
19
        app('CbDynamicMenus')->addSuperAdminMenu('CbMenu::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('CbMenu::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
        app('CbDynamicMenus')->addMenu('CbMenu::dynamic_menus');
0 ignored issues
show
Bug introduced by
The method addMenu() 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

20
        app('CbDynamicMenus')->/** @scrutinizer ignore-call */ addMenu('CbMenu::dynamic_menus');

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...
21
        $this->registerModule();
22
23
  /*    $hasDashboard = \Crocodicstudio\Crudbooster\Modules\MenuModule\MenuRepo::sidebarDashboard();
24
        if (false && $hasDashboard) {
25
            app('CbDynamicMenus')->addMenu('CbMenu::dashboard');
26
        }*/
27
    }
28
29
    /**
30
     * Register the application services.
31
     *
32
     * @return void
33
     */
34
    public function register()
35
    {
36
    }
37
38
    private function registerModule()
39
    {
40
        app('CbModulesRegistery')->addModule('menus', (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

40
        app('CbModulesRegistery')->/** @scrutinizer ignore-call */ addModule('menus', (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...
41
            'name' => trans('crudbooster.Menu_Management'),
42
            'icon' => 'fa fa-bars',
43
            'path' => 'menu_management',
44
            'table_name' => 'cms_menus',
45
            'controller' => 'MenusController',
46
            'is_protected' => 1,
47
            'is_active' => 1,
48
        ]);
49
    }
50
51
}
52