1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace LauLamanApps\eCurring\Resource\Proxy; |
||
6 | |||
7 | use DateTimeImmutable; |
||
8 | use LauLamanApps\eCurring\eCurringClientInterface; |
||
9 | use LauLamanApps\eCurring\Resource\Transaction; |
||
10 | use LauLamanApps\eCurring\Resource\Transaction\Event; |
||
11 | use LauLamanApps\eCurring\Resource\Transaction\PaymentMethod; |
||
12 | use LauLamanApps\eCurring\Resource\Transaction\Status; |
||
13 | use LauLamanApps\eCurring\Resource\TransactionInterface; |
||
14 | use Money\Money; |
||
15 | use Ramsey\Uuid\Uuid; |
||
16 | use Ramsey\Uuid\UuidInterface; |
||
17 | |||
18 | /** |
||
19 | * @method UuidInterface|null getId() |
||
20 | * @method Status|null getStatus() |
||
21 | * @method DateTimeImmutable|null getScheduledOn() |
||
22 | * @method DateTimeImmutable|null getDueDate() |
||
23 | * @method Money getAmount() |
||
24 | * @method DateTimeImmutable|null getCanceledOn() |
||
25 | * @method string|null getWebhookUrl() |
||
26 | * @method PaymentMethod getPaymentMethod() |
||
27 | * @method Event[] getHistory() |
||
28 | */ |
||
29 | final class TransactionProxy extends AbstractProxy implements TransactionInterface |
||
30 | { |
||
31 | /** |
||
32 | * @return Transaction |
||
33 | */ |
||
34 | protected function __load(eCurringClientInterface $client, string $id) |
||
35 | { |
||
36 | return $client->getTransaction(Uuid::fromString($id)); |
||
0 ignored issues
–
show
|
|||
37 | } |
||
38 | } |
||
39 |
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: