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

CbPrivilegesServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Crocodicstudio\Crudbooster\Modules\PrivilegeModule;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class CbPrivilegesServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap the application services.
11
     *
12
     * @return void
13
     */
14
    public function boot()
15
    {
16
        $this->app['view']->addNamespace('CbPrivilege', __DIR__.'/views');
17
        $this->loadRoutesFrom( __DIR__.'/privileges_routes.php');
18
        $this->publishes([__DIR__.'/localization' => resource_path('lang')], 'cb_localization');
19
        $this->loadMigrationsFrom(__DIR__ . '/migrations');
20
        app('CbDynamicMenus')->addSuperAdminMenu('CbPrivilege::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

20
        app('CbDynamicMenus')->/** @scrutinizer ignore-call */ addSuperAdminMenu('CbPrivilege::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...
21
        $this->registerModule();
22
    }
23
24
    /**
25
     * Register the application services.
26
     *
27
     * @return void
28
     */
29
    public function register()
30
    {
31
    }
32
33
34
    private function registerModule()
35
    {
36
        app('CbModulesRegistery')->addModule('privileges', (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

36
        app('CbModulesRegistery')->/** @scrutinizer ignore-call */ addModule('privileges', (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...
37
            'name' => trans('crudbooster.Privileges'),
38
            'icon' => 'fa fa-cog',
39
            'path' => 'privileges',
40
            'table_name' => 'cms_privileges',
41
            'controller' => 'PrivilegesController',
42
            'is_protected' => 1,
43
            'is_active' => 1,
44
        ]);
45
    }
46
47
}
48