Completed
Pull Request — Laravel4 (#36)
by
unknown
10:35
created

SteamApiServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 1 Features 0
Metric Value
c 3
b 1
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php namespace Syntax\SteamApi;
2
3
use Illuminate\Foundation\AliasLoader;
4
use Illuminate\Support\ServiceProvider;
5
6
class SteamApiServiceProvider extends ServiceProvider {
7
8
	/**
9
	 * Indicates if loading of the provider is deferred.
10
	 *
11
	 * @var bool
12
	 */
13
	protected $defer = false;
14
15
	/**
16
	 * Bootstrap the application events.
17
	 *
18
	 * @return void
19
	 */
20
	public function boot()
21
	{
22
		$this->package('syntax/steam-api');
23
	}
24
25
	/**
26
	 * Register the service provider.
27
	 *
28
	 * @return void
29
	 */
30
	public function register()
31
	{
32
		$this->registerAlias();
33
34
		$this->app['steam-api'] = $this->app->share(function()
35
		{
36
			return new Client;
37
		});
38
	}
39
40
	/**
41
	 * Register the alias for package.
42
	 *
43
	 * @return void
44
	 */
45
	protected function registerAlias()
46
	{
47
		$this->app->booting(function()
48
		{
49
			$loader = AliasLoader::getInstance();
50
			$loader->alias('Steam', 'Syntax\SteamApi\Facades\SteamApi');
51
		});
52
	}
53
54
	/**
55
	 * Get the services provided by the provider.
56
	 *
57
	 * @return string[]
58
	 */
59
	public function provides()
60
	{
61
		return array('steam-api');
62
	}
63
64
}
65