Issues (74)

src/NetsparkerCloudServiceProvider.php (1 issue)

Severity
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
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

38
        $this->app->bind(Client::class, function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
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