Completed
Pull Request — master (#78)
by
unknown
02:12
created

LaravelLogViewerServiceProvider::boot()   B

Complexity

Conditions 5
Paths 16

Size

Total Lines 32
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 32
rs 8.439
cc 5
eloc 12
nc 16
nop 0
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
		{
23
			$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...
24
		}
25
26
		if (method_exists($this, 'loadViewsFrom'))
27
		{
28
			$this->loadViewsFrom(__DIR__.'/../../views', 'laravel-log-viewer');
29
		}
30
31
		if (method_exists($this,'loadTranslationsFrom'))
32
        {
33
            $this->loadTranslationsFrom(__DIR__.'/../../lang', 'laravel-log-viewer');
34
        }
35
36
        if (method_exists($this,'publishes'))
37
        {
38
            $this->publishes([
39
40
                __DIR__.'/../../lang' => resource_path('lang/vendor/laravel-log-viewer'), //Copy lang folder
41
                __DIR__.'/../../views' =>   resource_path('views/vendor/laravel-log-viewer'), //Copy views folder
42
                __DIR__.'/../../config/laravel-log-viewer.php' => config_path('laravel-log-viewer.php'), //Copy config file
43
44
45
            ]);
46
        }
47
48
49
50
	}
51
52
	/**
53
	 * Register the service provider.
54
	 *
55
	 * @return void
56
	 */
57
	public function register()
58
	{
59
        $this->mergeConfigFrom(
60
            __DIR__.'/../../config/laravel-log-viewer.php', 'laravel-log-viewer'
61
        );
62
	}
63
64
	/**
65
	 * Get the services provided by the provider.
66
	 *
67
	 * @return array
68
	 */
69
	public function provides()
70
	{
71
		return array();
72
	}
73
74
}
75