Completed
Push — develop ( 161b6a...db1c6f )
by Bradley
04:19
created

BootstrapServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 6
Bugs 2 Features 0
Metric Value
wmc 3
c 6
b 2
f 0
lcom 1
cbo 3
dl 0
loc 48
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 5 1
A register() 0 11 1
A provides() 0 4 1
1
<?php namespace Cornford\Bootstrapper;
2
3
use Illuminate\Support\ServiceProvider;
4
5
class BootstrapServiceProvider extends ServiceProvider {
6
7
	/**
8
	 * Indicates if loading of the provider is deferred.
9
	 *
10
	 * @var bool
11
	 */
12
	protected $defer = true;
13
14
	/**
15
	 * Bootstrap the application events.
16
	 *
17
	 * @return void
18
	 */
19
	public function boot()
20
	{
21
		$assetPath = __DIR__.'/../../../public';
22
		$this->publishes([$assetPath => public_path('packages/cornford/bootstrapper')], 'bootstrapper');
23
	}
24
25
	/**
26
	 * Register the service provider.
27
	 *
28
	 * @return void
29
	 */
30
	public function register()
31
	{
32
		$this->app['bootstrap'] = $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...
33
		{
34
			return new Bootstrap(
35
				$this->app->make('Illuminate\Html\FormBuilder', ['csrfToken' => $app['session.store']->getToken()]),
36
				$this->app->make('Illuminate\Html\HtmlBuilder'),
37
				$this->app->make('Illuminate\Http\Request')
38
			);
39
		});
40
	}
41
42
	/**
43
	 * Get the services provided by the provider.
44
	 *
45
	 * @return string[]
46
	 */
47
	public function provides()
48
	{
49
		return array('bootstrap');
50
	}
51
52
}
53