Completed
Push — master ( 458c30...36624a )
by wen
11:48
created

ResourcesServiceProvider::loadRoutes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace Sco\Admin\Providers;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class ResourcesServiceProvider extends ServiceProvider
8
{
9
    public function getBasePath()
10
    {
11
        return dirname(dirname(__DIR__));
12
    }
13
14
    public function boot()
15
    {
16
        //$this->loadRoutes();
0 ignored issues
show
Unused Code Comprehensibility introduced by
84% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
17
18
        $this->loadViewsFrom(
19
            $this->getBasePath() . '/resources/views',
20
            'admin'
21
        );
22
23
        $this->loadTranslationsFrom(
24
            $this->getBasePath() . '/resources/lang',
25
            'admin'
26
        );
27
28
        if ($this->app->runningInConsole()) {
29
            $this->publishAssets();
30
            $this->publishConfig();
31
            $this->publishViews();
32
            $this->publishTranslations();
33
            //$this->publishRoutes();
0 ignored issues
show
Unused Code Comprehensibility introduced by
84% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
34
        }
35
    }
36
37
    public function register()
38
    {
39
    }
40
41
    protected function publishAssets()
42
    {
43
        $this->publishes([
44
            $this->getBasePath() . '/resources/assets' => base_path('resources/assets/vendor/admin'),
45
        ], 'assets');
46
    }
47
48
    protected function publishConfig()
49
    {
50
        $this->publishes([
51
            $this->getBasePath() . '/config/' => config_path(),
52
        ], 'config');
53
    }
54
55
    protected function publishViews()
56
    {
57
        $this->publishes([
58
            $this->getBasePath() . '/resources/views' => base_path('resources/views/vendor/admin'),
59
        ], 'views');
60
    }
61
62
    protected function publishTranslations()
63
    {
64
        $this->publishes([
65
            $this->getBasePath() . '/resources/lang' => base_path('resources/lang/vendor/admin'),
66
        ], 'lang');
67
    }
68
69
    /*protected function publishRoutes()
0 ignored issues
show
Unused Code Comprehensibility introduced by
60% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
70
    {
71
        $this->publishes([
72
            $this->getBasePath() . '/routes/admin.php' => base_path('routes/admin.php'),
73
        ], 'routes');
74
    }*/
75
76
    /*protected function loadRoutes()
0 ignored issues
show
Unused Code Comprehensibility introduced by
56% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
77
    {
78
        $routesFile = $this->getBasePath() . '/routes/admin.php';
79
        $this->loadRoutesFrom($routesFile);
80
    }*/
81
}
82