1 | <?php |
||
2 | |||
3 | namespace Montross50\NetsparkerCloud; |
||
4 | |||
5 | use Illuminate\Support\ServiceProvider; |
||
6 | use Montross50\NetsparkerCloud\SDK\Client; |
||
7 | use Montross50\NetsparkerCloud\SDK\Model\BasicAuthenticationSettingModel; |
||
8 | |||
9 | class NetsparkerCloudServiceProvider extends ServiceProvider |
||
10 | { |
||
11 | /** |
||
12 | * Perform post-registration booting of services. |
||
13 | * |
||
14 | * @return void |
||
15 | */ |
||
16 | 2 | public function boot() |
|
17 | { |
||
18 | 2 | $this->publishes([ |
|
19 | 2 | __DIR__ . '/../config/netsparker.php' => config_path('netsparker.php'), |
|
20 | ]); |
||
21 | 2 | } |
|
22 | |||
23 | /** |
||
24 | * Register any package services. |
||
25 | * |
||
26 | * @return void |
||
27 | */ |
||
28 | 2 | public function register() |
|
29 | { |
||
30 | 2 | $this->mergeConfigFrom( |
|
31 | 2 | __DIR__ . '/../config/netsparker.php', |
|
32 | 2 | 'netsparker' |
|
33 | ); |
||
34 | $this->app->bind(NetsparkerCloudInterface::class, function ($app) { |
||
35 | 2 | $api = $app->make(Client::class); |
|
36 | 2 | return $api; |
|
37 | 2 | }); |
|
38 | $this->app->bind(Client::class, function ($app) { |
||
0 ignored issues
–
show
|
|||
39 | |||
40 | 2 | $httpClient = \Http\Discovery\HttpClientDiscovery::find(); |
|
41 | 2 | $plugins = []; |
|
42 | 2 | $uri = \Http\Discovery\UriFactoryDiscovery::find()->createUri(config('netsparker.url')); |
|
43 | 2 | $plugins[] = new \Http\Client\Common\Plugin\AddHostPlugin($uri); |
|
44 | 2 | $auth = new \Http\Message\Authentication\BasicAuth( |
|
45 | 2 | config('netsparker.username'), |
|
46 | 2 | config('netsparker.password') |
|
47 | ); |
||
48 | 2 | $plugins[] = new \Http\Client\Common\Plugin\AuthenticationPlugin($auth); |
|
49 | 2 | $httpClient = new \Http\Client\Common\PluginClient($httpClient, $plugins); |
|
50 | 2 | return Client::create($httpClient); |
|
51 | 2 | }); |
|
52 | 2 | } |
|
53 | } |
||
54 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.