GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

ZbarQrdecoderServiceProvider::provides()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php namespace RobbieP\ZbarQrdecoder;
2
3
use Illuminate\Foundation\Application;
4
use Illuminate\Support\ServiceProvider;
5
6
class ZbarQrdecoderServiceProvider 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
	 * Actual provider
17
	 *
18
	 * @var \Illuminate\Support\ServiceProvider
19
	 */
20
	protected $provider;        
21
22
	/**
23
	 * Create a new service provider instance.
24
	 *
25
	 * @param  \Illuminate\Contracts\Foundation\Application  $app
26
	 * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
27
	 */
28
	public function __construct($app)
29
	{
30
		parent::__construct($app);
31
32
		$this->provider = $this->getProvider();
33
	}
34
35
	/**
36
	 * Bootstrap the application events.
37
	 *
38
	 * @return void
39
	 */
40
	public function boot()
41
	{
42
                $this->provider->boot();
43
	}
44
45
	/**
46
	 * Register the service provider.
47
	 *
48
	 * @return void
49
	 */
50
	public function register()
51
	{
52
                $this->provider->register();
53
	}
54
55
	/**
56
	 * Get the services provided by the provider.
57
	 *
58
	 * @return array
59
	 */
60
	public function provides()
61
	{
62
		return array('zbardecoder');
63
	}
64
65
	/**
66
	 * Return ServiceProvider according to Laravel version
67
	 *
68
	 * @return \Illuminate\Support\ServiceProvider
69
	 */
70
	private function getProvider()
71
	{
72
		$provider = '\RobbieP\ZbarQrdecoder\ZbarQrdecoderServiceProviderLaravel5';
73
74
		if (version_compare(Application::VERSION, '5.0', '<')) {
75
		    $provider = '\RobbieP\ZbarQrdecoder\ZbarQrdecoderServiceProviderLaravel4';
76
		}
77
78
		return new $provider($this->app);
79
	}
80
81
}
82