LaravelLogViewerServiceProvider::config_path()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 3
nc 4
nop 1
1
<?php namespace Rap2hpoutre\LaravelLogViewer;
2
3
use Illuminate\Support\ServiceProvider;
4
5
class LaravelLogViewerServiceProvider extends ServiceProvider {
6
7
    /**
8
     * Indicates if loading of the provider is deferred.
9
     *
10
     * @var bool
11
     */
12
    protected $defer = false;
13
14
    /**
15
     * Bootstrap the application events.
16
     *
17
     * @return void
18
     */
19
    public function boot()
20
    {
21
        if (method_exists($this, 'package')) {
22
            $this->package('rap2hpoutre/laravel-log-viewer', 'laravel-log-viewer', __DIR__ . '/../../');
0 ignored issues
show
Bug introduced by
The method package() does not seem to exist on object<Rap2hpoutre\Larav...gViewerServiceProvider>.

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...
23
        }
24
25
        if (method_exists($this, 'loadViewsFrom')) {
26
            $this->loadViewsFrom(__DIR__.'/../../views', 'laravel-log-viewer');
27
        }
28
        
29
        if (method_exists($this, 'publishes')) {
30
            $this->publishes([
31
                   __DIR__.'/../../views' => base_path('/resources/views/vendor/laravel-log-viewer'),
32
            ], 'views');
33
            $this->publishes([
34
                __DIR__.'/../../config/logviewer.php' => $this->config_path('logviewer.php'),
35
            ]);
36
37
        }
38
    }
39
40
    /**
41
     * Register the service provider.
42
     *
43
     * @return void
44
     */
45
    public function register()
46
    {
47
        //
48
    }
49
50
    /**
51
     * Get the services provided by the provider.
52
     *
53
     * @return array
54
     */
55
    public function provides()
56
    {
57
        return array();
58
    }
59
    
60
    /**
61
     * Get the configuration path.
62
     *
63
     * @param  string $path
64
     * @return string
65
     */
66
    private function config_path($path = '')
67
    {
68
        return function_exists('config_path') ? config_path($path) : app()->basePath() . DIRECTORY_SEPARATOR . 'config' . ($path ? DIRECTORY_SEPARATOR . $path : $path);
69
    }
70
71
}
72