Test Setup Failed
Pull Request — master (#5)
by Petr
04:25 queued 02:14
created

YourMembershipServiceProvider::provides()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace P2A\YourMembership;
3
4
use Illuminate\Support\ServiceProvider;
5
use P2A\YourMembership\YourMembershipClient;
6
7
class YourMembershipServiceProvider extends ServiceProvider
8
{
9
10
	private $packageName = 'yourmembership';
11
	private $packageConfigPath = __DIR__.'/config/yourmembership.php';
12
	/**
13
	 * Indicates if loading of the provider is deferred.
14
	 *
15
	 * @var bool
16
	 */
17
	protected $defer = true;
18
19
	/**
20
	 * Register the service provider.
21
	 *
22
	 * @return void
23
	 */
24
	public function register()
25
	{
26
		$this->mergeConfigFrom(
27
	    	$this->packageConfigPath, $this->packageName
28
		);
29
30
		$this->app->register(YourMembershipClient::class, function($app, $parameters) {
31
32
			$guzzleClient = new \GuzzleHttp\Client($app['config']['yourmembership']['guzzle-client']);
33
34
			return new YourMembershipClient($guzzleClient, $parameters[0], $parameters[1])
35
		});
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected '}', expecting ';'
Loading history...
36
	}
37
38
	public function boot()
39
	{
40
		$this->publishes([
41
		$this->packageConfigPath => config_path('yourmembership.php'),
42
		]);
43
	}
44
45
	/**
46
	 * Get the services provided by the provider.
47
	 *
48
	 * @return array
49
	 */
50
	public function provides()
51
	{
52
		return array(YourMembershipClient::class);
53
	}
54
55
}
56