MoipServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 8
Bugs 0 Features 1
Metric Value
c 8
b 0
f 1
dl 0
loc 22
rs 9.2
cc 1
eloc 20
nc 1
nop 0
1
<?php namespace SOSTheBlack\Moip;
2
3
use Illuminate\Support\ServiceProvider;
4
5
/**
6
 * Moip Service Provider
7
 * 
8
 * @author Jean Cesar Garcia <[email protected]>
9
 * @version v1.6.0
10
 * @license <a href="http://www.opensource.org/licenses/bsd-license.php">BSD License</a>
11
 */
12
class MoipServiceProvider extends ServiceProvider {
13
14
	/**
15
	 * Indicates if loading of the provider is deferred.
16
	 *
17
	 * @var bool
18
	 */
19
	protected $defer = false;
20
21
	/**
22
	 * Bootstrap the application events.
23
	 *
24
	 * @return void
25
	 */
26
	public function boot()
27
	{
28
		$this->package('sostheblack/moip', 'sostheblack');
0 ignored issues
show
Bug introduced by
The method package() does not seem to exist on object<SOSTheBlack\Moip\MoipServiceProvider>.

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...
29
		$this->commands('\SOSTheBlack\Moip\Commands\MoipAssetsCommand');
30
		$this->commands('\SOSTheBlack\Moip\Commands\MoipAuthCommand');
31
		$this->commands('\SOSTheBlack\Moip\Commands\MoipBilletCommand');
32
		$this->commands('\SOSTheBlack\Moip\Commands\MoipCommand');
33
		$this->commands('\SOSTheBlack\Moip\Commands\MoipConfigCommand');
34
		$this->commands('\SOSTheBlack\Moip\Commands\MoipCreditCardCommand');
35
		$this->commands('\SOSTheBlack\Moip\Commands\MoipDebitCardCommand');
36
		$this->commands('\SOSTheBlack\Moip\Commands\MoipFinancingCommand');
37
		$this->commands('\SOSTheBlack\Moip\Commands\MoipInstallCommand');
38
		$this->commands('\SOSTheBlack\Moip\Commands\MoipMigrateCommand');
39
		$this->commands('\SOSTheBlack\Moip\Commands\MoipPaymentCommand');
40
		$this->commands('\SOSTheBlack\Moip\Commands\MoipReasonCommand');
41
		$this->commands('\SOSTheBlack\Moip\Commands\MoipReceiverCommand');
42
		$this->commands('\SOSTheBlack\Moip\Commands\MoipSeedsCommand');
43
		$this->commands('\SOSTheBlack\Moip\Commands\MoipUrlReturnCommand');
44
		$this->commands('\SOSTheBlack\Moip\Commands\MoipUrlNotificationCommand');
45
		$path = $this->guessPackagePath();
0 ignored issues
show
Bug introduced by
The method guessPackagePath() does not seem to exist on object<SOSTheBlack\Moip\MoipServiceProvider>.

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...
46
        require_once $path.'/routes.php';
47
	}
48
49
	/**
50
	 * Register the service provider.
51
	 *
52
	 * @return void
53
	 */
54
	public function register()
55
	{
56
		$this->app->singleton('moip', function(){
57
			return new \SOSTheBlack\Moip\Moip;
58
		});
59
60
		$this->app->singleton('controller', function(){
61
			return new \SOSTheBlack\Moip\Controllers\MoipController;
62
		});
63
	}
64
65
	/**
66
	 * Get the services provided by the provider.
67
	 *
68
	 * @return string[]
69
	 */
70
	public function provides()
71
	{
72
		return array('sostheblack.moip', 'sostheblack.another-moip');
73
	}
74
75
}
76