Skip to content

Commit

Permalink
chore: Make StoreApiResponse generic and add proper typing
Browse files Browse the repository at this point in the history
  • Loading branch information
mitelg committed Feb 3, 2025
1 parent 6a415fd commit 7029257
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
use Shopware\Core\System\SalesChannel\StoreApiResponse;
use Swag\PayPal\RestApi\V2\Api\Order\PaymentSource\PayUponInvoice;

/**
* @extends StoreApiResponse<ArrayStruct>
*/
#[Package('checkout')]

Check failure on line 18 in src/Checkout/PUI/SalesChannel/PUIPaymentInstructionsResponse.php

View workflow job for this annotation

GitHub Actions / phpstan (trunk)

PHPDoc tag @extends contains generic type Shopware\Core\System\SalesChannel\StoreApiResponse<Shopware\Core\Framework\Struct\ArrayStruct> but class Shopware\Core\System\SalesChannel\StoreApiResponse is not generic.
class PUIPaymentInstructionsResponse extends StoreApiResponse
{
Expand Down
8 changes: 3 additions & 5 deletions src/Checkout/TokenResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@
use Shopware\Core\Framework\Struct\ArrayStruct;
use Shopware\Core\System\SalesChannel\StoreApiResponse;

/**
* @extends StoreApiResponse<ArrayStruct>
*/
#[Package('checkout')]

Check failure on line 17 in src/Checkout/TokenResponse.php

View workflow job for this annotation

GitHub Actions / phpstan (trunk)

PHPDoc tag @extends contains generic type Shopware\Core\System\SalesChannel\StoreApiResponse<Shopware\Core\Framework\Struct\ArrayStruct> but class Shopware\Core\System\SalesChannel\StoreApiResponse is not generic.
class TokenResponse extends StoreApiResponse
{
/**
* @var ArrayStruct<string, string>
*/
protected $object;

public function __construct(string $token)
{
parent::__construct(new ArrayStruct(['token' => $token]));
Expand Down

0 comments on commit 7029257

Please sign in to comment.