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); |
|
|
|
|
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
|
|
|
|
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.