Soap::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 3
1
<?php
2
declare(strict_types=1);
3
4
/**
5
 * Gateway Client Class
6
 * @category    Ticaje
7
 * @author      Max Demian <[email protected]>
8
 */
9
10
namespace Ticaje\AConnector\Gateway\Client;
11
12
use Ticaje\Contract\Factory\FactoryInterface;
13
use Ticaje\Contract\Patterns\Interfaces\Decorator\ResponderInterface;
14
15
use Ticaje\AConnector\Interfaces\Protocol\SoapClientInterface;
16
use Ticaje\AConnector\Interfaces\Provider\Authentication\AuthenticatorInterface;
17
18
/**
19
 * Class Soap
20
 * @package Ticaje\Connector\Gateway\Client
21
 */
22
class Soap extends Base implements SoapClientInterface
23
{
24
    protected $authenticator;
25
26
    /**
27
     * Soap constructor.
28
     * @param ResponderInterface $responder
29
     * @param FactoryInterface $clientFactory
30
     * @param AuthenticatorInterface $authenticator
31
     * Pending the Virtual Type on DC definition to create recipe for dependencies of this module
32
     * In a temporary basis we're gonna leave the implementation for this driver empty since it's not likely that we end up using it
33
     */
34
    public function __construct(
35
        ResponderInterface $responder,
36
        FactoryInterface $clientFactory,
37
        AuthenticatorInterface $authenticator
38
    ) {
39
        $this->authenticator = $authenticator;
40
        parent::__construct($responder, $clientFactory);
0 ignored issues
show
Bug introduced by
The call to Ticaje\AConnector\Gatewa...ent\Base::__construct() has too few arguments starting with implementor. ( Ignorable by Annotation )

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

40
        parent::/** @scrutinizer ignore-call */ 
41
                __construct($responder, $clientFactory);

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
41
    }
42
43
    /**
44
     * @inheritDoc
45
     */
46
    public function generateClient($credentials)
47
    {
48
        $config = ['options' => $this->authenticator->authenticate($credentials), 'wsdl' => $credentials['wsdl']];
49
        $this->client = $this->clientFactory->create($config);
50
        return $this->client;
51
    }
52
53
    /**
54
     * @inheritDoc
55
     */
56
    public function request($operation, array $params = [])
57
    {
58
        // TODO: Implement request() method.
59
    }
60
}
61