RatepayStub   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 33
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A installmentConfiguration() 0 3 1
A installmentCalculation() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Client\Ratepay\Zed;
9
10
use Generated\Shared\Transfer\QuoteTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\QuoteTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Spryker\Client\ZedRequest\ZedRequestClientInterface;
12
13
class RatepayStub implements RatepayStubInterface
14
{
15
    /**
16
     * @var \Spryker\Client\ZedRequest\ZedRequestClient
17
     */
18
    protected $zedRequestClient;
19
20
    /**
21
     * @param \Spryker\Client\ZedRequest\ZedRequestClientInterface $zedRequestClient
22
     */
23
    public function __construct(ZedRequestClientInterface $zedRequestClient)
24
    {
25
        $this->zedRequestClient = $zedRequestClient;
0 ignored issues
show
Documentation Bug introduced by
$zedRequestClient is of type Spryker\Client\ZedReques...dRequestClientInterface, but the property $zedRequestClient was declared to be of type Spryker\Client\ZedRequest\ZedRequestClient. Are you sure that you always receive this specific sub-class here, or does it make sense to add an instanceof check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.

Either this assignment is in error or an instanceof check should be added for that assignment.

class Alien {}

class Dalek extends Alien {}

class Plot
{
    /** @var  Dalek */
    public $villain;
}

$alien = new Alien();
$plot = new Plot();
if ($alien instanceof Dalek) {
    $plot->villain = $alien;
}
Loading history...
26
    }
27
28
    /**
29
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
30
     *
31
     * @return \Generated\Shared\Transfer\RatepayInstallmentConfigurationResponseTransfer
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...urationResponseTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
32
     */
33
    public function installmentConfiguration(QuoteTransfer $quoteTransfer)
34
    {
35
        return $this->zedRequestClient->call('/ratepay/gateway/installment-configuration', $quoteTransfer);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->zedRequest...ation', $quoteTransfer) returns the type Spryker\Shared\Kernel\Transfer\TransferInterface which is incompatible with the documented return type Generated\Shared\Transfe...urationResponseTransfer.
Loading history...
36
    }
37
38
    /**
39
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
40
     *
41
     * @return \Generated\Shared\Transfer\RatepayInstallmentCalculationResponseTransfer
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...ulationResponseTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
42
     */
43
    public function installmentCalculation(QuoteTransfer $quoteTransfer)
44
    {
45
        return $this->zedRequestClient->call('/ratepay/gateway/installment-calculation', $quoteTransfer);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->zedRequest...ation', $quoteTransfer) returns the type Spryker\Shared\Kernel\Transfer\TransferInterface which is incompatible with the documented return type Generated\Shared\Transfe...ulationResponseTransfer.
Loading history...
46
    }
47
}
48