Skip to content

5.0.0

Choose a tag to compare

@aporat aporat released this 27 Feb 15:32

Removed

  • Breaking: Removed the Windows Store validator: ReceiptValidator\WindowsStore\Validator and
    ReceiptValidator\WindowsStore\CacheInterface are gone, and the robrichards/xmlseclibs
    dependency was dropped with them.

Changed

  • Breaking: Minimum PHP version raised from ^7.3|^8.0 to ^8.2.
  • Breaking: Constructor arguments that used to be optional are now required (still nullable):
    Amazon\PurchaseItem::__construct(?array $jsonResponse),
    Amazon\Response::parseJsonResponse(?array $jsonResponse),
    iTunes\AbstractResponse::__construct(?array $data), iTunes\PurchaseItem::__construct(?array $data), iTunes\PendingRenewalInfo::__construct(?array $data). Passing a non-array (e.g. a
    string) to these now throws TypeError instead of RuntimeException('Response must be a scalar value').
  • Breaking: Amazon\Response::__construct(int $httpStatusCode = 200, ?array $jsonResponse = [])
    — the second parameter's default changed from null to [], so new Response(200) now parses an
    empty array and getPurchases() returns one empty PurchaseItem instead of an empty array; pass
    null explicitly to keep the old behaviour.
  • Breaking: Scalar parameter types and static return types added across
    GooglePlay\Validator: __construct(AndroidPublisher $service, bool $validationModePurchase = true), setPackageName(string), setPurchaseToken(string), setProductId(string),
    setValidationModePurchase(bool), setValidationSubscriptionV2(bool); validatePurchase(): PurchaseResponse, validateSubscription(): SubscriptionResponse, validateSubscriptionV2(): SubscriptionV2Response, getPublisherService(): ?AndroidPublisher.
  • Breaking: GooglePlay\Acknowledger::__construct() now requires string for $packageName,
    $productId, $purchaseToken and $strategy; acknowledge() is declared : bool.
  • Breaking: Return types declared on the Google Play response classes, so a missing field from
    Google now raises TypeError instead of returning null:
    AbstractResponse::getDeveloperPayload(): array|string, getAcknowledgementState(): int,
    getKind(): string; PurchaseResponse::getConsumptionState(): int, getPurchaseTimeMillis(): string, getDeveloperPayloadElement(string $key): string, getPurchaseState(): string;
    SubscriptionResponse::getAutoRenewing(): bool, getCancelReason(): ?int, getCountryCode(): string, getPriceAmountMicros(): string, getPriceCurrencyCode(): string,
    getStartTimeMillis(): string, getExpiryTimeMillis(): int, getUserCancellationTimeMillis(): ?int, getPaymentState(): int, getExpiresDate(): string, getExternalAccountId(): string.
  • GooglePlay\SubscriptionResponse::getPriceAmountMicros() is now documented and typed as string
    (Google returns the int64 as a string); it was previously documented as int.
  • iTunes\PurchaseItem and iTunes\PendingRenewalInfo ArrayAccess methods now carry native
    return types (offsetSet(): void, offsetGet(): mixed, offsetUnset(): void, offsetExists(): bool); subclasses overriding them must match.
  • All classes now use typed properties (Amazon\*, GooglePlay\*, iTunes\*); subclasses that
    redeclare these protected properties must use compatible types.
  • composer.json: phpunit/phpunit dev dependency raised to ^11.0; minimum-stability: dev with
    prefer-stable: true added (affects the repository only, not consumers).
  • Note: the original release notes said only "PHP 8.2 minimum required, Removed Windows Store
    validator, Code style improvements"; the signature/return-type changes above are user-visible and
    the Amazon\Response default change is a behaviour change.

Notes written from the code diff for this release; see CHANGELOG.md.