etrias-nl /
paazl-connector
| 1 | <?php |
||
| 2 | |||
| 3 | /* |
||
| 4 | * This file is part of PHP CS Fixer. |
||
| 5 | * |
||
| 6 | * (c) Fabien Potencier <[email protected]> |
||
| 7 | * Dariusz RumiĆski <[email protected]> |
||
| 8 | * |
||
| 9 | * This source file is subject to the MIT license that is bundled |
||
| 10 | * with this source code in the file LICENSE. |
||
| 11 | */ |
||
| 12 | |||
| 13 | namespace Etrias\PaazlConnector\Services; |
||
| 14 | |||
| 15 | use Etrias\PaazlConnector\Client\PaazlClientInterface; |
||
| 16 | use Etrias\PaazlConnector\SoapTypes\BaseCheckoutRequestType; |
||
| 17 | |||
| 18 | class CheckoutService implements CheckoutServiceInterface |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * @var PaazlClientInterface |
||
| 22 | */ |
||
| 23 | protected $client; |
||
| 24 | /** |
||
| 25 | * @var SecurityServiceInterface |
||
| 26 | */ |
||
| 27 | protected $security; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * DocumentService constructor. |
||
| 31 | * |
||
| 32 | * @param PaazlClientInterface $client |
||
| 33 | * @param SecurityServiceInterface $security |
||
| 34 | */ |
||
| 35 | public function __construct(PaazlClientInterface $client, SecurityServiceInterface $security) |
||
| 36 | { |
||
| 37 | $this->security = $security; |
||
| 38 | $this->client = $client; |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * {@inheritdoc} |
||
| 43 | */ |
||
| 44 | View Code Duplication | public function getCheckoutUrl($orderReference, $targetWebShop = null) |
|
| 45 | { |
||
| 46 | $request = new BaseCheckoutRequestType( |
||
| 47 | $this->security->getHash($orderReference), |
||
| 48 | $this->client->getWebShopId(), |
||
| 49 | $targetWebShop, |
||
| 50 | $orderReference |
||
| 51 | ); |
||
| 52 | |||
| 53 | return $this->client->checkout($request); |
||
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * {@inheritdoc} |
||
| 58 | */ |
||
| 59 | View Code Duplication | public function getCheckoutStatus($orderReference, $targetWebShop = null) |
|
| 60 | { |
||
| 61 | $request = new BaseCheckoutRequestType( |
||
| 62 | $this->security->getHash($orderReference), |
||
| 63 | $this->client->getWebShopId(), |
||
| 64 | $targetWebShop, |
||
| 65 | $orderReference |
||
| 66 | ); |
||
| 67 | |||
| 68 | return $this->client->checkoutStatus($request); |
||
|
0 ignored issues
–
show
|
|||
| 69 | } |
||
| 70 | } |
||
| 71 |
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: