Issues (456)

src/SprykerEco/Client/Ratepay/Zed/RatepayStub.php (1 issue)

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;
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
32
     */
33
    public function installmentConfiguration(QuoteTransfer $quoteTransfer)
34
    {
35
        return $this->zedRequestClient->call('/ratepay/gateway/installment-configuration', $quoteTransfer);
36
    }
37
38
    /**
39
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
40
     *
41
     * @return \Generated\Shared\Transfer\RatepayInstallmentCalculationResponseTransfer
42
     */
43
    public function installmentCalculation(QuoteTransfer $quoteTransfer)
44
    {
45
        return $this->zedRequestClient->call('/ratepay/gateway/installment-calculation', $quoteTransfer);
46
    }
47
}
48