Completed
Push — develop ( 91f7cb...427e9b )
by Bradley
04:11
created

SettingServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 4
Bugs 0 Features 1
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 57
rs 10
c 4
b 0
f 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 10 1
A register() 0 15 1
A provides() 0 4 1
1
<?php namespace Cornford\Setter;
2
3
use Illuminate\Support\ServiceProvider;
4
5
class SettingServiceProvider 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
		$this->publishes(
22
			[
23
				__DIR__ . '/../../config/config.php' => config_path('setter.php'),
24
				__DIR__ . '/../../migrations/' => database_path('/migrations')
25
			],
26
			'setter'
27
		);
28
	}
29
30
	/**
31
	 * Register the service provider.
32
	 *
33
	 * @return void
34
	 */
35
	public function register()
36
	{
37
		$configPath = __DIR__ . '/../../config/config.php';
38
		$this->mergeConfigFrom($configPath, 'googlmapper');
39
40
		$this->app['setting'] = $this->app->share(function($app)
0 ignored issues
show
Bug introduced by
The method share() does not seem to exist on object<Illuminate\Contra...Foundation\Application>.

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
		{
42
			return new Setting(
43
				$this->app->make('Illuminate\Database\DatabaseManager'),
44
				$this->app->make('Illuminate\Config\Repository'),
45
				$this->app->make('Illuminate\Cache\Repository'),
46
				$app['config']->get('googlmapper')
47
			);
48
		});
49
	}
50
51
	/**
52
	 * Get the services provided by the provider.
53
	 *
54
	 * @return array
55
	 */
56
	public function provides()
57
	{
58
		return array('setting');
59
	}
60
61
}
62