Passed
Push — master ( 542807...000b7f )
by Hector Luis
11:24
created

Base::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 1
1
<?php
2
declare(strict_types=1);
3
4
/**
5
 * Gateway Class
6
 * @category    Ticaje
7
 * @package     Ticaje_Connector
8
 * @author      Hector Luis Barrientos <[email protected]>
9
 */
10
11
namespace Ticaje\Connector\Gateway\Provider;
12
13
use Ticaje\Connector\Interfaces\ClientInterface;
14
15
/**
16
 * Class Base
17
 * @package Ticaje\Connector\Gateway\Provider
18
 */
19
abstract class Base
20
{
21
    protected $connector;
22
23
    protected $params;
24
25
    /**
26
     * Base constructor.
27
     * @param ClientInterface $connector
28
     */
29
    public function __construct(
30
        ClientInterface $connector
31
    ) {
32
        $this->connector = $connector;
33
    }
34
35
    public function initialize($credentials)
36
    {
37
        $this->connector->generateClient($credentials);
0 ignored issues
show
Bug introduced by
The method generateClient() does not exist on Ticaje\Connector\Interfaces\ClientInterface. It seems like you code against a sub-type of said class. However, the method does not exist in Ticaje\Connector\Gateway\Client\Base or Ticaje\Connector\Interfa...col\RestClientInterface or Ticaje\Connector\Interfa...col\SoapClientInterface. Are you sure you never get one of those? ( Ignorable by Annotation )

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

37
        $this->connector->/** @scrutinizer ignore-call */ 
38
                          generateClient($credentials);
Loading history...
38
        return $this;
39
    }
40
}
41