diff --git a/src/Contracts/ServerNotificationContract.php b/src/Contracts/ServerNotificationContract.php index 93649ed..016a041 100644 --- a/src/Contracts/ServerNotificationContract.php +++ b/src/Contracts/ServerNotificationContract.php @@ -4,7 +4,7 @@ namespace Imdhemy\Purchases\Contracts; -use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; /** * Interface ServerNotificationContract. @@ -22,7 +22,7 @@ public function getType(): string; /** * Gets the subscription associated with the notification. */ - public function getSubscription(?Client $client = null): SubscriptionContract; + public function getSubscription(?ClientInterface $client = null): SubscriptionContract; /** * Returns true if the notification is a test notification. diff --git a/src/Events/AppStore/Cancel.php b/src/Events/AppStore/Cancel.php index 6217b48..df4746a 100644 --- a/src/Events/AppStore/Cancel.php +++ b/src/Events/AppStore/Cancel.php @@ -5,7 +5,11 @@ namespace Imdhemy\Purchases\Events\AppStore; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\AppStoreServerNotification; +/** + * @method AppStoreServerNotification getServerNotification() + */ class Cancel extends PurchaseEvent { } diff --git a/src/Events/AppStore/ConsumptionRequest.php b/src/Events/AppStore/ConsumptionRequest.php index a1ada14..4c4c9bb 100644 --- a/src/Events/AppStore/ConsumptionRequest.php +++ b/src/Events/AppStore/ConsumptionRequest.php @@ -5,7 +5,12 @@ namespace Imdhemy\Purchases\Events\AppStore; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\AppStoreServerNotification; +use Imdhemy\Purchases\ServerNotifications\AppStoreV2ServerNotification; +/** + * @method AppStoreServerNotification|AppStoreV2ServerNotification getServerNotification() + */ class ConsumptionRequest extends PurchaseEvent { } diff --git a/src/Events/AppStore/DidChangeRenewalPref.php b/src/Events/AppStore/DidChangeRenewalPref.php index 9c0ee9e..a62286e 100644 --- a/src/Events/AppStore/DidChangeRenewalPref.php +++ b/src/Events/AppStore/DidChangeRenewalPref.php @@ -9,6 +9,9 @@ use Imdhemy\Purchases\ServerNotifications\AppStoreServerNotification; use Imdhemy\Purchases\ServerNotifications\AppStoreV2ServerNotification; +/** + * @method AppStoreServerNotification|AppStoreV2ServerNotification getServerNotification() + */ class DidChangeRenewalPref extends PurchaseEvent { public function getAutoRenewProductId(): ?string diff --git a/src/Events/AppStore/DidChangeRenewalStatus.php b/src/Events/AppStore/DidChangeRenewalStatus.php index fd6f5ce..d77bd4e 100644 --- a/src/Events/AppStore/DidChangeRenewalStatus.php +++ b/src/Events/AppStore/DidChangeRenewalStatus.php @@ -11,6 +11,9 @@ use Imdhemy\Purchases\ServerNotifications\AppStoreV2ServerNotification; use Imdhemy\Purchases\ValueObjects\Time; +/** + * @method AppStoreServerNotification|AppStoreV2ServerNotification getServerNotification() + */ class DidChangeRenewalStatus extends PurchaseEvent { public function isAutoRenewal(): bool diff --git a/src/Events/AppStore/DidFailToRenew.php b/src/Events/AppStore/DidFailToRenew.php index 29af653..9b537de 100644 --- a/src/Events/AppStore/DidFailToRenew.php +++ b/src/Events/AppStore/DidFailToRenew.php @@ -5,7 +5,12 @@ namespace Imdhemy\Purchases\Events\AppStore; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\AppStoreServerNotification; +use Imdhemy\Purchases\ServerNotifications\AppStoreV2ServerNotification; +/** + * @method AppStoreServerNotification|AppStoreV2ServerNotification getServerNotification() + */ class DidFailToRenew extends PurchaseEvent { } diff --git a/src/Events/AppStore/DidRecover.php b/src/Events/AppStore/DidRecover.php index 470f64d..6aa2f18 100644 --- a/src/Events/AppStore/DidRecover.php +++ b/src/Events/AppStore/DidRecover.php @@ -5,7 +5,11 @@ namespace Imdhemy\Purchases\Events\AppStore; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\AppStoreServerNotification; +/** + * @method AppStoreServerNotification getServerNotification() + */ class DidRecover extends PurchaseEvent { } diff --git a/src/Events/AppStore/DidRenew.php b/src/Events/AppStore/DidRenew.php index 82928fa..8957236 100644 --- a/src/Events/AppStore/DidRenew.php +++ b/src/Events/AppStore/DidRenew.php @@ -5,7 +5,12 @@ namespace Imdhemy\Purchases\Events\AppStore; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\AppStoreServerNotification; +use Imdhemy\Purchases\ServerNotifications\AppStoreV2ServerNotification; +/** + * @method AppStoreServerNotification|AppStoreV2ServerNotification getServerNotification() + */ class DidRenew extends PurchaseEvent { } diff --git a/src/Events/AppStore/Expired.php b/src/Events/AppStore/Expired.php index b5e4c49..34898a1 100644 --- a/src/Events/AppStore/Expired.php +++ b/src/Events/AppStore/Expired.php @@ -5,7 +5,11 @@ namespace Imdhemy\Purchases\Events\AppStore; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\AppStoreV2ServerNotification; +/** + * @method AppStoreV2ServerNotification getServerNotification() + */ class Expired extends PurchaseEvent { } diff --git a/src/Events/AppStore/GracePeriodExpired.php b/src/Events/AppStore/GracePeriodExpired.php index 004ee7c..85d03f8 100644 --- a/src/Events/AppStore/GracePeriodExpired.php +++ b/src/Events/AppStore/GracePeriodExpired.php @@ -5,7 +5,11 @@ namespace Imdhemy\Purchases\Events\AppStore; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\AppStoreV2ServerNotification; +/** + * @method AppStoreV2ServerNotification getServerNotification() + */ class GracePeriodExpired extends PurchaseEvent { } diff --git a/src/Events/AppStore/InitialBuy.php b/src/Events/AppStore/InitialBuy.php index 5ae8b1d..74a151f 100644 --- a/src/Events/AppStore/InitialBuy.php +++ b/src/Events/AppStore/InitialBuy.php @@ -5,7 +5,11 @@ namespace Imdhemy\Purchases\Events\AppStore; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\AppStoreServerNotification; +/** + * @method AppStoreServerNotification getServerNotification() + */ class InitialBuy extends PurchaseEvent { } diff --git a/src/Events/AppStore/InteractiveRenewal.php b/src/Events/AppStore/InteractiveRenewal.php index 937091d..5b7751f 100644 --- a/src/Events/AppStore/InteractiveRenewal.php +++ b/src/Events/AppStore/InteractiveRenewal.php @@ -5,7 +5,11 @@ namespace Imdhemy\Purchases\Events\AppStore; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\AppStoreServerNotification; +/** + * @method AppStoreServerNotification getServerNotification() + */ class InteractiveRenewal extends PurchaseEvent { } diff --git a/src/Events/AppStore/OfferRedeemed.php b/src/Events/AppStore/OfferRedeemed.php index b0df078..e4945b8 100644 --- a/src/Events/AppStore/OfferRedeemed.php +++ b/src/Events/AppStore/OfferRedeemed.php @@ -5,7 +5,11 @@ namespace Imdhemy\Purchases\Events\AppStore; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\AppStoreV2ServerNotification; +/** + * @method AppStoreV2ServerNotification getServerNotification() + */ class OfferRedeemed extends PurchaseEvent { } diff --git a/src/Events/AppStore/PriceIncrease.php b/src/Events/AppStore/PriceIncrease.php index 3ccf9ba..c7e231e 100644 --- a/src/Events/AppStore/PriceIncrease.php +++ b/src/Events/AppStore/PriceIncrease.php @@ -5,7 +5,11 @@ namespace Imdhemy\Purchases\Events\AppStore; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\AppStoreV2ServerNotification; +/** + * @method AppStoreV2ServerNotification getServerNotification() + */ class PriceIncrease extends PurchaseEvent { } diff --git a/src/Events/AppStore/PriceIncreaseConsent.php b/src/Events/AppStore/PriceIncreaseConsent.php index f90be8d..a529b3a 100644 --- a/src/Events/AppStore/PriceIncreaseConsent.php +++ b/src/Events/AppStore/PriceIncreaseConsent.php @@ -5,7 +5,11 @@ namespace Imdhemy\Purchases\Events\AppStore; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\AppStoreServerNotification; +/** + * @method AppStoreServerNotification getServerNotification() + */ class PriceIncreaseConsent extends PurchaseEvent { } diff --git a/src/Events/AppStore/Refund.php b/src/Events/AppStore/Refund.php index d5b7ae5..f36e1fa 100644 --- a/src/Events/AppStore/Refund.php +++ b/src/Events/AppStore/Refund.php @@ -5,7 +5,12 @@ namespace Imdhemy\Purchases\Events\AppStore; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\AppStoreServerNotification; +use Imdhemy\Purchases\ServerNotifications\AppStoreV2ServerNotification; +/** + * @method AppStoreServerNotification|AppStoreV2ServerNotification getServerNotification() + */ class Refund extends PurchaseEvent { } diff --git a/src/Events/AppStore/RefundDeclined.php b/src/Events/AppStore/RefundDeclined.php index fbb0ce1..82f9db8 100644 --- a/src/Events/AppStore/RefundDeclined.php +++ b/src/Events/AppStore/RefundDeclined.php @@ -5,7 +5,11 @@ namespace Imdhemy\Purchases\Events\AppStore; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\AppStoreV2ServerNotification; +/** + * @method AppStoreV2ServerNotification getServerNotification() + */ class RefundDeclined extends PurchaseEvent { } diff --git a/src/Events/AppStore/Renewal.php b/src/Events/AppStore/Renewal.php index c42d232..0be33dd 100644 --- a/src/Events/AppStore/Renewal.php +++ b/src/Events/AppStore/Renewal.php @@ -5,10 +5,13 @@ namespace Imdhemy\Purchases\Events\AppStore; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\AppStoreServerNotification; /** * @deprecated use \Imdhemy\Purchases\Events\AppStore\DidRecover instead - * @see \Imdhemy\Purchases\Events\AppStore\DidRecover + * @see DidRecover + * + * @method AppStoreServerNotification getServerNotification() */ class Renewal extends PurchaseEvent { diff --git a/src/Events/AppStore/Revoke.php b/src/Events/AppStore/Revoke.php index f014fca..0d2753c 100644 --- a/src/Events/AppStore/Revoke.php +++ b/src/Events/AppStore/Revoke.php @@ -5,7 +5,12 @@ namespace Imdhemy\Purchases\Events\AppStore; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\AppStoreServerNotification; +use Imdhemy\Purchases\ServerNotifications\AppStoreV2ServerNotification; +/** + * @method AppStoreServerNotification|AppStoreV2ServerNotification getServerNotification() + */ class Revoke extends PurchaseEvent { } diff --git a/src/Events/AppStore/Subscribed.php b/src/Events/AppStore/Subscribed.php index 81dcef6..7edb7bc 100644 --- a/src/Events/AppStore/Subscribed.php +++ b/src/Events/AppStore/Subscribed.php @@ -5,7 +5,11 @@ namespace Imdhemy\Purchases\Events\AppStore; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\AppStoreV2ServerNotification; +/** + * @method AppStoreV2ServerNotification getServerNotification() + */ class Subscribed extends PurchaseEvent { } diff --git a/src/Events/GooglePlay/SubscriptionCanceled.php b/src/Events/GooglePlay/SubscriptionCanceled.php index b0e5a4f..97ffa34 100644 --- a/src/Events/GooglePlay/SubscriptionCanceled.php +++ b/src/Events/GooglePlay/SubscriptionCanceled.php @@ -5,7 +5,11 @@ namespace Imdhemy\Purchases\Events\GooglePlay; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\GoogleServerNotification; +/** + * @method GoogleServerNotification getServerNotification() + */ class SubscriptionCanceled extends PurchaseEvent { } diff --git a/src/Events/GooglePlay/SubscriptionDeferred.php b/src/Events/GooglePlay/SubscriptionDeferred.php index abdf7a7..80e1500 100644 --- a/src/Events/GooglePlay/SubscriptionDeferred.php +++ b/src/Events/GooglePlay/SubscriptionDeferred.php @@ -5,7 +5,11 @@ namespace Imdhemy\Purchases\Events\GooglePlay; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\GoogleServerNotification; +/** + * @method GoogleServerNotification getServerNotification() + */ class SubscriptionDeferred extends PurchaseEvent { } diff --git a/src/Events/GooglePlay/SubscriptionExpired.php b/src/Events/GooglePlay/SubscriptionExpired.php index fd3f5c1..acf8112 100644 --- a/src/Events/GooglePlay/SubscriptionExpired.php +++ b/src/Events/GooglePlay/SubscriptionExpired.php @@ -5,7 +5,11 @@ namespace Imdhemy\Purchases\Events\GooglePlay; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\GoogleServerNotification; +/** + * @method GoogleServerNotification getServerNotification() + */ class SubscriptionExpired extends PurchaseEvent { } diff --git a/src/Events/GooglePlay/SubscriptionInGracePeriod.php b/src/Events/GooglePlay/SubscriptionInGracePeriod.php index 8ee643d..dd3e845 100644 --- a/src/Events/GooglePlay/SubscriptionInGracePeriod.php +++ b/src/Events/GooglePlay/SubscriptionInGracePeriod.php @@ -5,7 +5,11 @@ namespace Imdhemy\Purchases\Events\GooglePlay; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\GoogleServerNotification; +/** + * @method GoogleServerNotification getServerNotification() + */ class SubscriptionInGracePeriod extends PurchaseEvent { } diff --git a/src/Events/GooglePlay/SubscriptionOnHold.php b/src/Events/GooglePlay/SubscriptionOnHold.php index d91c033..0bc6fdc 100644 --- a/src/Events/GooglePlay/SubscriptionOnHold.php +++ b/src/Events/GooglePlay/SubscriptionOnHold.php @@ -5,7 +5,11 @@ namespace Imdhemy\Purchases\Events\GooglePlay; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\GoogleServerNotification; +/** + * @method GoogleServerNotification getServerNotification() + */ class SubscriptionOnHold extends PurchaseEvent { } diff --git a/src/Events/GooglePlay/SubscriptionPauseScheduleChanged.php b/src/Events/GooglePlay/SubscriptionPauseScheduleChanged.php index 907bde9..da5ff1c 100644 --- a/src/Events/GooglePlay/SubscriptionPauseScheduleChanged.php +++ b/src/Events/GooglePlay/SubscriptionPauseScheduleChanged.php @@ -5,7 +5,11 @@ namespace Imdhemy\Purchases\Events\GooglePlay; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\GoogleServerNotification; +/** + * @method GoogleServerNotification getServerNotification() + */ class SubscriptionPauseScheduleChanged extends PurchaseEvent { } diff --git a/src/Events/GooglePlay/SubscriptionPaused.php b/src/Events/GooglePlay/SubscriptionPaused.php index 464e61a..7a642bc 100644 --- a/src/Events/GooglePlay/SubscriptionPaused.php +++ b/src/Events/GooglePlay/SubscriptionPaused.php @@ -5,7 +5,11 @@ namespace Imdhemy\Purchases\Events\GooglePlay; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\GoogleServerNotification; +/** + * @method GoogleServerNotification getServerNotification() + */ class SubscriptionPaused extends PurchaseEvent { } diff --git a/src/Events/GooglePlay/SubscriptionPriceChangeConfirmed.php b/src/Events/GooglePlay/SubscriptionPriceChangeConfirmed.php index 8f132fe..accd9fc 100644 --- a/src/Events/GooglePlay/SubscriptionPriceChangeConfirmed.php +++ b/src/Events/GooglePlay/SubscriptionPriceChangeConfirmed.php @@ -5,7 +5,11 @@ namespace Imdhemy\Purchases\Events\GooglePlay; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\GoogleServerNotification; +/** + * @method GoogleServerNotification getServerNotification() + */ class SubscriptionPriceChangeConfirmed extends PurchaseEvent { } diff --git a/src/Events/GooglePlay/SubscriptionPurchased.php b/src/Events/GooglePlay/SubscriptionPurchased.php index 985ca6b..7633f99 100644 --- a/src/Events/GooglePlay/SubscriptionPurchased.php +++ b/src/Events/GooglePlay/SubscriptionPurchased.php @@ -5,9 +5,10 @@ namespace Imdhemy\Purchases\Events\GooglePlay; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\GoogleServerNotification; /** - * Class SubscriptionPurchased. + * @method GoogleServerNotification getServerNotification() */ class SubscriptionPurchased extends PurchaseEvent { diff --git a/src/Events/GooglePlay/SubscriptionRecovered.php b/src/Events/GooglePlay/SubscriptionRecovered.php index c7872e5..c132998 100644 --- a/src/Events/GooglePlay/SubscriptionRecovered.php +++ b/src/Events/GooglePlay/SubscriptionRecovered.php @@ -5,7 +5,11 @@ namespace Imdhemy\Purchases\Events\GooglePlay; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\GoogleServerNotification; +/** + * @method GoogleServerNotification getServerNotification() + */ class SubscriptionRecovered extends PurchaseEvent { } diff --git a/src/Events/GooglePlay/SubscriptionRenewed.php b/src/Events/GooglePlay/SubscriptionRenewed.php index f3b5d49..38b7d04 100644 --- a/src/Events/GooglePlay/SubscriptionRenewed.php +++ b/src/Events/GooglePlay/SubscriptionRenewed.php @@ -5,7 +5,11 @@ namespace Imdhemy\Purchases\Events\GooglePlay; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\GoogleServerNotification; +/** + * @method GoogleServerNotification getServerNotification() + */ class SubscriptionRenewed extends PurchaseEvent { } diff --git a/src/Events/GooglePlay/SubscriptionRestarted.php b/src/Events/GooglePlay/SubscriptionRestarted.php index 0c411bf..6381caf 100644 --- a/src/Events/GooglePlay/SubscriptionRestarted.php +++ b/src/Events/GooglePlay/SubscriptionRestarted.php @@ -5,7 +5,11 @@ namespace Imdhemy\Purchases\Events\GooglePlay; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\GoogleServerNotification; +/** + * @method GoogleServerNotification getServerNotification() + */ class SubscriptionRestarted extends PurchaseEvent { } diff --git a/src/Events/GooglePlay/SubscriptionRevoked.php b/src/Events/GooglePlay/SubscriptionRevoked.php index 2d1688e..9edd0cc 100644 --- a/src/Events/GooglePlay/SubscriptionRevoked.php +++ b/src/Events/GooglePlay/SubscriptionRevoked.php @@ -5,7 +5,11 @@ namespace Imdhemy\Purchases\Events\GooglePlay; use Imdhemy\Purchases\Events\PurchaseEvent; +use Imdhemy\Purchases\ServerNotifications\GoogleServerNotification; +/** + * @method GoogleServerNotification getServerNotification() + */ class SubscriptionRevoked extends PurchaseEvent { } diff --git a/src/Events/PurchaseEvent.php b/src/Events/PurchaseEvent.php index 9ae125c..14626f6 100644 --- a/src/Events/PurchaseEvent.php +++ b/src/Events/PurchaseEvent.php @@ -4,24 +4,19 @@ namespace Imdhemy\Purchases\Events; -use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Queue\SerializesModels; use Imdhemy\Purchases\Contracts\PurchaseEventContract; use Imdhemy\Purchases\Contracts\ServerNotificationContract; use Imdhemy\Purchases\Contracts\SubscriptionContract; -use Imdhemy\Purchases\ServerNotifications\AppStoreServerNotification; -use Imdhemy\Purchases\ServerNotifications\GoogleServerNotification; abstract class PurchaseEvent implements PurchaseEventContract { use Dispatchable; use SerializesModels; - /** - * @var ServerNotificationContract|AppStoreServerNotification|GoogleServerNotification - */ - protected $serverNotification; + protected ServerNotificationContract $serverNotification; /** * SubscriptionPurchased constructor. @@ -36,7 +31,7 @@ public function getServerNotification(): ServerNotificationContract return $this->serverNotification; } - public function getSubscription(?Client $client = null): SubscriptionContract + public function getSubscription(?ClientInterface $client = null): SubscriptionContract { return $this->serverNotification->getSubscription($client); } diff --git a/src/ServerNotifications/AppStoreServerNotification.php b/src/ServerNotifications/AppStoreServerNotification.php index b3f05e7..df30fbb 100644 --- a/src/ServerNotifications/AppStoreServerNotification.php +++ b/src/ServerNotifications/AppStoreServerNotification.php @@ -4,7 +4,7 @@ namespace Imdhemy\Purchases\ServerNotifications; -use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; use Imdhemy\AppStore\ServerNotifications\ServerNotification; use Imdhemy\AppStore\ValueObjects\LatestReceiptInfo; use Imdhemy\Purchases\Contracts\ServerNotificationContract; @@ -29,7 +29,7 @@ public function getType(): string return $this->notification->getNotificationType(); } - public function getSubscription(?Client $client = null): SubscriptionContract + public function getSubscription(?ClientInterface $client = null): SubscriptionContract { $firstReceipt = $this->getFirstReceipt(); assert($firstReceipt instanceof LatestReceiptInfo); diff --git a/src/ServerNotifications/AppStoreV2ServerNotification.php b/src/ServerNotifications/AppStoreV2ServerNotification.php index e4e7852..317eb53 100644 --- a/src/ServerNotifications/AppStoreV2ServerNotification.php +++ b/src/ServerNotifications/AppStoreV2ServerNotification.php @@ -4,7 +4,7 @@ namespace Imdhemy\Purchases\ServerNotifications; -use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; use Imdhemy\AppStore\ServerNotifications\V2DecodedPayload; use Imdhemy\Purchases\Contracts\HasSubtype; use Imdhemy\Purchases\Contracts\ServerNotificationContract; @@ -36,7 +36,7 @@ public function getType(): string return $this->payload->getType(); } - public function getSubscription(?Client $client = null): SubscriptionContract + public function getSubscription(?ClientInterface $client = null): SubscriptionContract { return AppleSubscription::fromV2DecodedPayload($this->payload); } diff --git a/src/ServerNotifications/GoogleServerNotification.php b/src/ServerNotifications/GoogleServerNotification.php index 2cfc8cf..a649481 100644 --- a/src/ServerNotifications/GoogleServerNotification.php +++ b/src/ServerNotifications/GoogleServerNotification.php @@ -4,7 +4,7 @@ namespace Imdhemy\Purchases\ServerNotifications; -use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; use GuzzleHttp\Exception\GuzzleException; use Imdhemy\GooglePlay\DeveloperNotifications\DeveloperNotification; use Imdhemy\Purchases\Contracts\ServerNotificationContract; @@ -40,7 +40,7 @@ public function getType(): string /** * @throws GuzzleException */ - public function getSubscription(?Client $client = null): SubscriptionContract + public function getSubscription(?ClientInterface $client = null): SubscriptionContract { return GoogleSubscription::createFromDeveloperNotification($this->notification, $client); }