diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 4958fe4..b9f1624 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -37,6 +37,11 @@ 'spacing' => 'one', ], 'self_accessor' => true, + 'nullable_type_declaration' => ['syntax' => 'union'], + 'ordered_types' => [ + 'null_adjustment' => 'always_last', + 'sort_algorithm' => 'none', + ], ]) ->setRiskyAllowed(true) ->setFinder($finder); diff --git a/composer.json b/composer.json index f77ebe9..fbf4ce0 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "symfony/serializer": "^5.4 || ^6.3 || ^7.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "3.48", + "friendsofphp/php-cs-fixer": "^3.49", "guzzlehttp/psr7": "^2.6", "monolog/monolog": "^3.5", "php-http/curl-client": "^2.3", diff --git a/src/Client.php b/src/Client.php index b5f72ba..64cb3a7 100644 --- a/src/Client.php +++ b/src/Client.php @@ -81,12 +81,12 @@ class Client public function __construct( #[\SensitiveParameter] private readonly string $apiKey, - Options $options = null, - HttpAsyncClient $httpClient = null, - LoggerInterface $logger = null, - RequestFactoryInterface $requestFactory = null, - StreamFactoryInterface $streamFactory = null, - UriFactoryInterface $uriFactory = null, + Options|null $options = null, + HttpAsyncClient|null $httpClient = null, + LoggerInterface|null $logger = null, + RequestFactoryInterface|null $requestFactory = null, + StreamFactoryInterface|null $streamFactory = null, + UriFactoryInterface|null $uriFactory = null, ) { $this->options = $options ?: new Options(); $this->logger = $logger ?: new NullLogger(); @@ -159,7 +159,7 @@ public function deleteRaw(string|UriInterface $uri): ResponseInterface return $this->requestRaw('DELETE', $uri); } - private function requestRaw(string $method, string|UriInterface $uri, array|\JsonSerializable $payload = null): ResponseInterface + private function requestRaw(string $method, string|UriInterface $uri, array|\JsonSerializable|null $payload = null): ResponseInterface { if (\is_string($uri)) { $components = \parse_url($this->options->environment->baseUrl()); diff --git a/src/Entities/Collections/AddressCollection.php b/src/Entities/Collections/AddressCollection.php index 0f98a9c..0f02d3c 100644 --- a/src/Entities/Collections/AddressCollection.php +++ b/src/Entities/Collections/AddressCollection.php @@ -15,7 +15,7 @@ class AddressCollection extends Collection { - public static function from(array $itemsData, Paginator $paginator = null): self + public static function from(array $itemsData, Paginator|null $paginator = null): self { return new self( array_map(fn (array $item): Address => Address::from($item), $itemsData), diff --git a/src/Entities/Collections/AdjustmentCollection.php b/src/Entities/Collections/AdjustmentCollection.php index e18d618..62e14cb 100644 --- a/src/Entities/Collections/AdjustmentCollection.php +++ b/src/Entities/Collections/AdjustmentCollection.php @@ -15,7 +15,7 @@ class AdjustmentCollection extends Collection { - public static function from(array $itemsData, Paginator $paginator = null): self + public static function from(array $itemsData, Paginator|null $paginator = null): self { return new self( array_map(fn (array $item): Adjustment => Adjustment::from($item), $itemsData), diff --git a/src/Entities/Collections/BusinessCollection.php b/src/Entities/Collections/BusinessCollection.php index 749dceb..ef2663f 100644 --- a/src/Entities/Collections/BusinessCollection.php +++ b/src/Entities/Collections/BusinessCollection.php @@ -15,7 +15,7 @@ class BusinessCollection extends Collection { - public static function from(array $itemsData, Paginator $paginator = null): self + public static function from(array $itemsData, Paginator|null $paginator = null): self { return new self( array_map(fn (array $item): Business => Business::from($item), $itemsData), diff --git a/src/Entities/Collections/Collection.php b/src/Entities/Collections/Collection.php index a816460..728ef4c 100644 --- a/src/Entities/Collections/Collection.php +++ b/src/Entities/Collections/Collection.php @@ -12,11 +12,11 @@ abstract class Collection implements \Iterator public function __construct( protected array $items, - protected ?Paginator $paginator = null, + protected Paginator|null $paginator = null, ) { } - abstract public static function from(array $data, ?Paginator $paginator): self; + abstract public static function from(array $data, Paginator|null $paginator): self; public function current(): Entity { diff --git a/src/Entities/Collections/CreditBalanceCollection.php b/src/Entities/Collections/CreditBalanceCollection.php index c9f3087..05f11cd 100644 --- a/src/Entities/Collections/CreditBalanceCollection.php +++ b/src/Entities/Collections/CreditBalanceCollection.php @@ -15,7 +15,7 @@ class CreditBalanceCollection extends Collection { - public static function from(array $itemsData, Paginator $paginator = null): self + public static function from(array $itemsData, Paginator|null $paginator = null): self { return new self( array_map(fn (array $item): CreditBalance => CreditBalance::from($item), $itemsData), diff --git a/src/Entities/Collections/CustomerCollection.php b/src/Entities/Collections/CustomerCollection.php index c909e87..1d3f303 100644 --- a/src/Entities/Collections/CustomerCollection.php +++ b/src/Entities/Collections/CustomerCollection.php @@ -15,7 +15,7 @@ class CustomerCollection extends Collection { - public static function from(array $itemsData, Paginator $paginator = null): self + public static function from(array $itemsData, Paginator|null $paginator = null): self { return new self( array_map(fn (array $item): Customer => Customer::from($item), $itemsData), diff --git a/src/Entities/Collections/DiscountCollection.php b/src/Entities/Collections/DiscountCollection.php index 2a1b718..aa188d3 100644 --- a/src/Entities/Collections/DiscountCollection.php +++ b/src/Entities/Collections/DiscountCollection.php @@ -15,7 +15,7 @@ class DiscountCollection extends Collection { - public static function from(array $itemsData, Paginator $paginator = null): self + public static function from(array $itemsData, Paginator|null $paginator = null): self { return new self( array_map(fn (array $item): Discount => Discount::from($item), $itemsData), diff --git a/src/Entities/Collections/EventCollection.php b/src/Entities/Collections/EventCollection.php index 588c5b2..b3b1e5e 100644 --- a/src/Entities/Collections/EventCollection.php +++ b/src/Entities/Collections/EventCollection.php @@ -15,7 +15,7 @@ class EventCollection extends Collection { - public static function from(array $itemsData, Paginator $paginator = null): self + public static function from(array $itemsData, Paginator|null $paginator = null): self { return new self( array_map(fn (array $item): Event => Event::from($item), $itemsData), diff --git a/src/Entities/Collections/EventTypeCollection.php b/src/Entities/Collections/EventTypeCollection.php index c3d54ef..2b736be 100644 --- a/src/Entities/Collections/EventTypeCollection.php +++ b/src/Entities/Collections/EventTypeCollection.php @@ -15,7 +15,7 @@ class EventTypeCollection extends Collection { - public static function from(array $itemsData, Paginator $paginator = null): self + public static function from(array $itemsData, Paginator|null $paginator = null): self { return new self( array_map(fn (array $item): EventType => EventType::from($item), $itemsData), diff --git a/src/Entities/Collections/NotificationCollection.php b/src/Entities/Collections/NotificationCollection.php index 1aa8d99..fa053b6 100644 --- a/src/Entities/Collections/NotificationCollection.php +++ b/src/Entities/Collections/NotificationCollection.php @@ -15,7 +15,7 @@ class NotificationCollection extends Collection { - public static function from(array $itemsData, Paginator $paginator = null): self + public static function from(array $itemsData, Paginator|null $paginator = null): self { return new self( array_map(fn (array $item): Notification => Notification::from($item), $itemsData), diff --git a/src/Entities/Collections/NotificationLogCollection.php b/src/Entities/Collections/NotificationLogCollection.php index 271c1c5..035f2c4 100644 --- a/src/Entities/Collections/NotificationLogCollection.php +++ b/src/Entities/Collections/NotificationLogCollection.php @@ -15,7 +15,7 @@ class NotificationLogCollection extends Collection { - public static function from(array $itemsData, Paginator $paginator = null): self + public static function from(array $itemsData, Paginator|null $paginator = null): self { return new self( array_map(fn (array $item): NotificationLog => NotificationLog::from($item), $itemsData), diff --git a/src/Entities/Collections/NotificationSettingCollection.php b/src/Entities/Collections/NotificationSettingCollection.php index 1e3067c..eaa098f 100644 --- a/src/Entities/Collections/NotificationSettingCollection.php +++ b/src/Entities/Collections/NotificationSettingCollection.php @@ -15,7 +15,7 @@ class NotificationSettingCollection extends Collection { - public static function from(array $itemsData, Paginator $paginator = null): self + public static function from(array $itemsData, Paginator|null $paginator = null): self { return new self( array_map(fn (array $item): NotificationSetting => NotificationSetting::from($item), $itemsData), diff --git a/src/Entities/Collections/PriceCollection.php b/src/Entities/Collections/PriceCollection.php index 32fc87f..7fb0f5a 100644 --- a/src/Entities/Collections/PriceCollection.php +++ b/src/Entities/Collections/PriceCollection.php @@ -15,7 +15,7 @@ class PriceCollection extends Collection { - public static function from(array $itemsData, Paginator $paginator = null): self + public static function from(array $itemsData, Paginator|null $paginator = null): self { return new self( array_map(fn (array $item): Price => Price::from($item), $itemsData), diff --git a/src/Entities/Collections/ProductCollection.php b/src/Entities/Collections/ProductCollection.php index 3a23250..0c4479c 100644 --- a/src/Entities/Collections/ProductCollection.php +++ b/src/Entities/Collections/ProductCollection.php @@ -15,7 +15,7 @@ class ProductCollection extends Collection { - public static function from(array $itemsData, Paginator $paginator = null): self + public static function from(array $itemsData, Paginator|null $paginator = null): self { return new self( array_map(fn (array $item): Product => Product::from($item), $itemsData), diff --git a/src/Entities/Collections/ReportCollection.php b/src/Entities/Collections/ReportCollection.php index d5fa608..3cdb771 100644 --- a/src/Entities/Collections/ReportCollection.php +++ b/src/Entities/Collections/ReportCollection.php @@ -15,7 +15,7 @@ class ReportCollection extends Collection { - public static function from(array $itemsData, Paginator $paginator = null): self + public static function from(array $itemsData, Paginator|null $paginator = null): self { return new self( array_map(fn (array $item): Report => Report::from($item), $itemsData), diff --git a/src/Entities/Collections/SubscriptionCollection.php b/src/Entities/Collections/SubscriptionCollection.php index 40fdc8c..622179d 100644 --- a/src/Entities/Collections/SubscriptionCollection.php +++ b/src/Entities/Collections/SubscriptionCollection.php @@ -15,7 +15,7 @@ class SubscriptionCollection extends Collection { - public static function from(array $itemsData, Paginator $paginator = null): self + public static function from(array $itemsData, Paginator|null $paginator = null): self { return new self( array_map(fn (array $item): Subscription => Subscription::from($item), $itemsData), diff --git a/src/Entities/Collections/SubscriptionPreviewCollection.php b/src/Entities/Collections/SubscriptionPreviewCollection.php index 2258580..f9bd1fb 100644 --- a/src/Entities/Collections/SubscriptionPreviewCollection.php +++ b/src/Entities/Collections/SubscriptionPreviewCollection.php @@ -15,7 +15,7 @@ class SubscriptionPreviewCollection extends Collection { - public static function from(array $itemsData, Paginator $paginator = null): self + public static function from(array $itemsData, Paginator|null $paginator = null): self { return new self( array_map(fn (array $item): SubscriptionPreview => SubscriptionPreview::from($item), $itemsData), diff --git a/src/Entities/Collections/SubscriptionsTransactionCollection.php b/src/Entities/Collections/SubscriptionsTransactionCollection.php index 0a18087..63d8c8a 100644 --- a/src/Entities/Collections/SubscriptionsTransactionCollection.php +++ b/src/Entities/Collections/SubscriptionsTransactionCollection.php @@ -15,7 +15,7 @@ class SubscriptionsTransactionCollection extends Collection { - public static function from(array $itemsData, Paginator $paginator = null): self + public static function from(array $itemsData, Paginator|null $paginator = null): self { return new self( array_map(fn (array $item): SubscriptionTransaction => SubscriptionTransaction::from($item), $itemsData), diff --git a/src/Entities/Collections/TransactionCollection.php b/src/Entities/Collections/TransactionCollection.php index 7f1356d..5cec347 100644 --- a/src/Entities/Collections/TransactionCollection.php +++ b/src/Entities/Collections/TransactionCollection.php @@ -15,7 +15,7 @@ class TransactionCollection extends Collection { - public static function from(array $itemsData, Paginator $paginator = null): self + public static function from(array $itemsData, Paginator|null $paginator = null): self { return new self( array_map(fn (array $item): Transaction => Transaction::from($item), $itemsData), diff --git a/src/Entities/Collections/TransactionPreviewCollection.php b/src/Entities/Collections/TransactionPreviewCollection.php index 1e18466..37310f3 100644 --- a/src/Entities/Collections/TransactionPreviewCollection.php +++ b/src/Entities/Collections/TransactionPreviewCollection.php @@ -15,7 +15,7 @@ class TransactionPreviewCollection extends Collection { - public static function from(array $itemsData, Paginator $paginator = null): self + public static function from(array $itemsData, Paginator|null $paginator = null): self { return new self( array_map(fn (array $item): TransactionPreview => TransactionPreview::from($item), $itemsData), diff --git a/src/Entities/Collections/TransactionsDataCollection.php b/src/Entities/Collections/TransactionsDataCollection.php index 02503b5..4258ec2 100644 --- a/src/Entities/Collections/TransactionsDataCollection.php +++ b/src/Entities/Collections/TransactionsDataCollection.php @@ -15,7 +15,7 @@ class TransactionsDataCollection extends Collection { - public static function from(array $itemsData, Paginator $paginator = null): self + public static function from(array $itemsData, Paginator|null $paginator = null): self { return new self( array_map(fn (array $item): TransactionData => TransactionData::from($item), $itemsData), diff --git a/src/Entities/DateTime.php b/src/Entities/DateTime.php index f80a607..17190b1 100644 --- a/src/Entities/DateTime.php +++ b/src/Entities/DateTime.php @@ -14,7 +14,7 @@ public function __construct(string $datetime = 'now') parent::__construct(datetime: $datetime, timezone: new \DateTimeZone('UTC')); } - public function format(string $format = null): string + public function format(string|null $format = null): string { return parent::format($format ?? self::PADDLE_RFC3339); } diff --git a/src/Entities/Product.php b/src/Entities/Product.php index 4126eb8..fd6477d 100644 --- a/src/Entities/Product.php +++ b/src/Entities/Product.php @@ -26,7 +26,7 @@ public function __construct( public string|null $description, public CatalogType|null $type, public TaxCategory $taxCategory, - public null|string $imageUrl, + public string|null $imageUrl, public CustomData|null $customData, public Status $status, public \DateTimeInterface|null $createdAt, diff --git a/src/Entities/Subscription/SubscriptionNonCatalogProduct.php b/src/Entities/Subscription/SubscriptionNonCatalogProduct.php index 72b2c18..83d21f1 100644 --- a/src/Entities/Subscription/SubscriptionNonCatalogProduct.php +++ b/src/Entities/Subscription/SubscriptionNonCatalogProduct.php @@ -22,7 +22,7 @@ public function __construct( public string|null $description, public CatalogType|null $type, public TaxCategory $taxCategory, - public null|string $imageUrl, + public string|null $imageUrl, public CustomData|null $customData, ) { } diff --git a/src/Entities/Transaction/TransactionNonCatalogProduct.php b/src/Entities/Transaction/TransactionNonCatalogProduct.php index 7a48476..533eb30 100644 --- a/src/Entities/Transaction/TransactionNonCatalogProduct.php +++ b/src/Entities/Transaction/TransactionNonCatalogProduct.php @@ -20,7 +20,7 @@ public function __construct( public string $name, public string|null $description, public TaxCategory $taxCategory, - public null|string $imageUrl, + public string|null $imageUrl, public CustomData|null $customData, ) { } diff --git a/src/Notifications/Verifier.php b/src/Notifications/Verifier.php index ea12c70..b7008e2 100644 --- a/src/Notifications/Verifier.php +++ b/src/Notifications/Verifier.php @@ -9,7 +9,7 @@ final class Verifier { public function __construct( - private readonly ?int $maximumVariance = 5, + private readonly int|null $maximumVariance = 5, ) { } diff --git a/src/Resources/Addresses/Operations/CreateAddress.php b/src/Resources/Addresses/Operations/CreateAddress.php index c795387..5e5700d 100644 --- a/src/Resources/Addresses/Operations/CreateAddress.php +++ b/src/Resources/Addresses/Operations/CreateAddress.php @@ -15,13 +15,13 @@ class CreateAddress implements \JsonSerializable public function __construct( public readonly CountryCode $countryCode, - public readonly string|null|Undefined $description = new Undefined(), - public readonly string|null|Undefined $firstLine = new Undefined(), - public readonly string|null|Undefined $secondLine = new Undefined(), - public readonly string|null|Undefined $city = new Undefined(), - public readonly string|null|Undefined $postalCode = new Undefined(), - public readonly string|null|Undefined $region = new Undefined(), - public readonly CustomData|null|Undefined $customData = new Undefined(), + public readonly string|Undefined|null $description = new Undefined(), + public readonly string|Undefined|null $firstLine = new Undefined(), + public readonly string|Undefined|null $secondLine = new Undefined(), + public readonly string|Undefined|null $city = new Undefined(), + public readonly string|Undefined|null $postalCode = new Undefined(), + public readonly string|Undefined|null $region = new Undefined(), + public readonly CustomData|Undefined|null $customData = new Undefined(), ) { } diff --git a/src/Resources/Addresses/Operations/ListAddresses.php b/src/Resources/Addresses/Operations/ListAddresses.php index bbae867..d13e766 100644 --- a/src/Resources/Addresses/Operations/ListAddresses.php +++ b/src/Resources/Addresses/Operations/ListAddresses.php @@ -12,10 +12,10 @@ class ListAddresses implements HasParameters { public function __construct( - private readonly ?Pager $pager = null, + private readonly Pager|null $pager = null, private readonly array $ids = [], private readonly array $statuses = [], - private readonly ?string $search = null, + private readonly string|null $search = null, ) { if ($invalid = array_filter($this->ids, fn ($value): bool => ! is_string($value))) { throw InvalidArgumentException::arrayContainsInvalidTypes('ids', 'string', implode(', ', $invalid)); diff --git a/src/Resources/Addresses/Operations/UpdateAddress.php b/src/Resources/Addresses/Operations/UpdateAddress.php index 2b1312b..27c935b 100644 --- a/src/Resources/Addresses/Operations/UpdateAddress.php +++ b/src/Resources/Addresses/Operations/UpdateAddress.php @@ -16,13 +16,13 @@ class UpdateAddress implements \JsonSerializable public function __construct( public readonly CountryCode|Undefined $countryCode = new Undefined(), - public readonly string|null|Undefined $description = new Undefined(), - public readonly string|null|Undefined $firstLine = new Undefined(), - public readonly string|null|Undefined $secondLine = new Undefined(), - public readonly string|null|Undefined $city = new Undefined(), - public readonly string|null|Undefined $postalCode = new Undefined(), - public readonly string|null|Undefined $region = new Undefined(), - public readonly CustomData|null|Undefined $customData = new Undefined(), + public readonly string|Undefined|null $description = new Undefined(), + public readonly string|Undefined|null $firstLine = new Undefined(), + public readonly string|Undefined|null $secondLine = new Undefined(), + public readonly string|Undefined|null $city = new Undefined(), + public readonly string|Undefined|null $postalCode = new Undefined(), + public readonly string|Undefined|null $region = new Undefined(), + public readonly CustomData|Undefined|null $customData = new Undefined(), public readonly Status|Undefined $status = new Undefined(), ) { } diff --git a/src/Resources/Adjustments/Operations/ListAdjustments.php b/src/Resources/Adjustments/Operations/ListAdjustments.php index 6914503..8574092 100644 --- a/src/Resources/Adjustments/Operations/ListAdjustments.php +++ b/src/Resources/Adjustments/Operations/ListAdjustments.php @@ -22,13 +22,13 @@ class ListAdjustments implements HasParameters * @throws InvalidArgumentException On invalid array arguments */ public function __construct( - private readonly ?Pager $pager = null, + private readonly Pager|null $pager = null, private readonly array $ids = [], private readonly array $statuses = [], private readonly array $customerIds = [], private readonly array $transactionIds = [], private readonly array $subscriptionIds = [], - private readonly ?Action $action = null, + private readonly Action|null $action = null, ) { if ($invalid = array_filter($this->ids, fn ($value): bool => ! is_string($value))) { throw InvalidArgumentException::arrayContainsInvalidTypes('ids', 'string', implode(', ', $invalid)); diff --git a/src/Resources/Businesses/Operations/CreateBusiness.php b/src/Resources/Businesses/Operations/CreateBusiness.php index 0320715..9e6bd27 100644 --- a/src/Resources/Businesses/Operations/CreateBusiness.php +++ b/src/Resources/Businesses/Operations/CreateBusiness.php @@ -18,10 +18,10 @@ class CreateBusiness implements \JsonSerializable */ public function __construct( public readonly string $name, - public readonly string|null|Undefined $companyNumber = new Undefined(), - public readonly string|null|Undefined $taxIdentifier = new Undefined(), + public readonly string|Undefined|null $companyNumber = new Undefined(), + public readonly string|Undefined|null $taxIdentifier = new Undefined(), public readonly array|Undefined $contacts = new Undefined(), - public readonly CustomData|null|Undefined $customData = new Undefined(), + public readonly CustomData|Undefined|null $customData = new Undefined(), ) { } diff --git a/src/Resources/Businesses/Operations/ListBusinesses.php b/src/Resources/Businesses/Operations/ListBusinesses.php index 6aade5f..38d80d1 100644 --- a/src/Resources/Businesses/Operations/ListBusinesses.php +++ b/src/Resources/Businesses/Operations/ListBusinesses.php @@ -18,10 +18,10 @@ class ListBusinesses implements HasParameters * @throws InvalidArgumentException On invalid array contents */ public function __construct( - private readonly ?Pager $pager = null, + private readonly Pager|null $pager = null, private readonly array $ids = [], private readonly array $statuses = [], - private readonly ?string $search = null, + private readonly string|null $search = null, ) { if ($invalid = array_filter($this->ids, fn ($value): bool => ! is_string($value))) { throw InvalidArgumentException::arrayContainsInvalidTypes('ids', 'string', implode(', ', $invalid)); diff --git a/src/Resources/Businesses/Operations/UpdateBusiness.php b/src/Resources/Businesses/Operations/UpdateBusiness.php index 2fe3ccd..80d9824 100644 --- a/src/Resources/Businesses/Operations/UpdateBusiness.php +++ b/src/Resources/Businesses/Operations/UpdateBusiness.php @@ -19,10 +19,10 @@ class UpdateBusiness implements \JsonSerializable */ public function __construct( public readonly string|Undefined $name = new Undefined(), - public readonly string|null|Undefined $companyNumber = new Undefined(), - public readonly string|null|Undefined $taxIdentifier = new Undefined(), + public readonly string|Undefined|null $companyNumber = new Undefined(), + public readonly string|Undefined|null $taxIdentifier = new Undefined(), public readonly array|Undefined $contacts = new Undefined(), - public readonly CustomData|null|Undefined $customData = new Undefined(), + public readonly CustomData|Undefined|null $customData = new Undefined(), public readonly Status|Undefined $status = new Undefined(), ) { } diff --git a/src/Resources/Customers/Operations/CreateCustomer.php b/src/Resources/Customers/Operations/CreateCustomer.php index 9d6de44..23274ef 100644 --- a/src/Resources/Customers/Operations/CreateCustomer.php +++ b/src/Resources/Customers/Operations/CreateCustomer.php @@ -14,8 +14,8 @@ class CreateCustomer implements \JsonSerializable public function __construct( public readonly string $email, - public readonly string|null|Undefined $name = new Undefined(), - public readonly CustomData|null|Undefined $customData = new Undefined(), + public readonly string|Undefined|null $name = new Undefined(), + public readonly CustomData|Undefined|null $customData = new Undefined(), public readonly string|Undefined $locale = new Undefined(), ) { } diff --git a/src/Resources/Customers/Operations/ListCustomers.php b/src/Resources/Customers/Operations/ListCustomers.php index a594498..cf378d1 100644 --- a/src/Resources/Customers/Operations/ListCustomers.php +++ b/src/Resources/Customers/Operations/ListCustomers.php @@ -18,10 +18,10 @@ class ListCustomers implements HasParameters * @throws InvalidArgumentException On invalid array contents */ public function __construct( - private readonly ?Pager $pager = null, + private readonly Pager|null $pager = null, private readonly array $ids = [], private readonly array $statuses = [], - private readonly ?string $search = null, + private readonly string|null $search = null, private readonly array $emails = [], ) { if ($invalid = array_filter($this->ids, fn ($value): bool => ! is_string($value))) { diff --git a/src/Resources/Customers/Operations/UpdateCustomer.php b/src/Resources/Customers/Operations/UpdateCustomer.php index db85137..15626aa 100644 --- a/src/Resources/Customers/Operations/UpdateCustomer.php +++ b/src/Resources/Customers/Operations/UpdateCustomer.php @@ -15,8 +15,8 @@ class UpdateCustomer implements \JsonSerializable public function __construct( public readonly string|Undefined $email = new Undefined(), - public readonly string|null|Undefined $name = new Undefined(), - public readonly CustomData|null|Undefined $customData = new Undefined(), + public readonly string|Undefined|null $name = new Undefined(), + public readonly CustomData|Undefined|null $customData = new Undefined(), public readonly string|Undefined $locale = new Undefined(), public readonly Status|Undefined $status = new Undefined(), ) { diff --git a/src/Resources/Discounts/Operations/CreateDiscount.php b/src/Resources/Discounts/Operations/CreateDiscount.php index 5028324..8c9b611 100644 --- a/src/Resources/Discounts/Operations/CreateDiscount.php +++ b/src/Resources/Discounts/Operations/CreateDiscount.php @@ -23,11 +23,11 @@ public function __construct( public readonly bool $enabledForCheckout, public readonly bool $recur, public readonly CurrencyCode $currencyCode, - public readonly string|null|Undefined $code = new Undefined(), - public readonly int|null|Undefined $maximumRecurringIntervals = new Undefined(), - public readonly int|null|Undefined $usageLimit = new Undefined(), - public readonly array|null|Undefined $restrictTo = new Undefined(), - public readonly string|null|Undefined $expiresAt = new Undefined(), + public readonly string|Undefined|null $code = new Undefined(), + public readonly int|Undefined|null $maximumRecurringIntervals = new Undefined(), + public readonly int|Undefined|null $usageLimit = new Undefined(), + public readonly array|Undefined|null $restrictTo = new Undefined(), + public readonly string|Undefined|null $expiresAt = new Undefined(), ) { } diff --git a/src/Resources/Discounts/Operations/ListDiscounts.php b/src/Resources/Discounts/Operations/ListDiscounts.php index 5bfcc1c..6ac6422 100644 --- a/src/Resources/Discounts/Operations/ListDiscounts.php +++ b/src/Resources/Discounts/Operations/ListDiscounts.php @@ -19,7 +19,7 @@ class ListDiscounts implements HasParameters * @throws InvalidArgumentException On invalid array contents */ public function __construct( - private readonly ?Pager $pager = null, + private readonly Pager|null $pager = null, private readonly array $ids = [], private readonly array $statuses = [], private readonly array $codes = [], diff --git a/src/Resources/Discounts/Operations/UpdateDiscount.php b/src/Resources/Discounts/Operations/UpdateDiscount.php index beb03a4..7378394 100644 --- a/src/Resources/Discounts/Operations/UpdateDiscount.php +++ b/src/Resources/Discounts/Operations/UpdateDiscount.php @@ -24,11 +24,11 @@ public function __construct( public readonly bool|Undefined $enabledForCheckout = new Undefined(), public readonly bool|Undefined $recur = new Undefined(), public readonly CurrencyCode|Undefined $currencyCode = new Undefined(), - public readonly string|null|Undefined $code = new Undefined(), - public readonly int|null|Undefined $maximumRecurringIntervals = new Undefined(), - public readonly int|null|Undefined $usageLimit = new Undefined(), - public readonly array|null|Undefined $restrictTo = new Undefined(), - public readonly string|null|Undefined $expiresAt = new Undefined(), + public readonly string|Undefined|null $code = new Undefined(), + public readonly int|Undefined|null $maximumRecurringIntervals = new Undefined(), + public readonly int|Undefined|null $usageLimit = new Undefined(), + public readonly array|Undefined|null $restrictTo = new Undefined(), + public readonly string|Undefined|null $expiresAt = new Undefined(), public readonly DiscountStatus|Undefined $status = new Undefined(), ) { } diff --git a/src/Resources/Events/Operations/ListEvents.php b/src/Resources/Events/Operations/ListEvents.php index 5cb5008..d2615e5 100644 --- a/src/Resources/Events/Operations/ListEvents.php +++ b/src/Resources/Events/Operations/ListEvents.php @@ -9,7 +9,7 @@ class ListEvents implements HasParameters { - public function __construct(private readonly ?Pager $pager = null) + public function __construct(private readonly Pager|null $pager = null) { } diff --git a/src/Resources/NotificationLogs/Operations/ListNotificationLogs.php b/src/Resources/NotificationLogs/Operations/ListNotificationLogs.php index 9a4b598..e323a8c 100644 --- a/src/Resources/NotificationLogs/Operations/ListNotificationLogs.php +++ b/src/Resources/NotificationLogs/Operations/ListNotificationLogs.php @@ -9,7 +9,7 @@ class ListNotificationLogs implements HasParameters { - public function __construct(private readonly ?Pager $pager = null) + public function __construct(private readonly Pager|null $pager = null) { } diff --git a/src/Resources/Notifications/Operations/ListNotifications.php b/src/Resources/Notifications/Operations/ListNotifications.php index 871b9c5..e774087 100644 --- a/src/Resources/Notifications/Operations/ListNotifications.php +++ b/src/Resources/Notifications/Operations/ListNotifications.php @@ -16,7 +16,7 @@ class ListNotifications implements HasParameters * @param array $status */ public function __construct( - private readonly ?Pager $pager = null, + private readonly Pager|null $pager = null, private readonly array $notificationSettingId = [], private readonly string|null $search = null, private readonly array $status = [], diff --git a/src/Resources/Prices/Operations/CreatePrice.php b/src/Resources/Prices/Operations/CreatePrice.php index 1798674..4407a29 100644 --- a/src/Resources/Prices/Operations/CreatePrice.php +++ b/src/Resources/Prices/Operations/CreatePrice.php @@ -25,12 +25,12 @@ public function __construct( public readonly string $description, public readonly string $productId, public readonly Money $unitPrice, - public readonly string|null|Undefined $name = new Undefined(), - public readonly CatalogType|null|Undefined $type = new Undefined(), + public readonly string|Undefined|null $name = new Undefined(), + public readonly CatalogType|Undefined|null $type = new Undefined(), public readonly array|Undefined $unitPriceOverrides = new Undefined(), public readonly TaxMode|Undefined $taxMode = new Undefined(), - public readonly TimePeriod|null|Undefined $trialPeriod = new Undefined(), - public readonly TimePeriod|null|Undefined $billingCycle = new Undefined(), + public readonly TimePeriod|Undefined|null $trialPeriod = new Undefined(), + public readonly TimePeriod|Undefined|null $billingCycle = new Undefined(), public readonly PriceQuantity|Undefined $quantity = new Undefined(), public readonly CustomData|Undefined $customData = new Undefined(), ) { diff --git a/src/Resources/Prices/Operations/ListPrices.php b/src/Resources/Prices/Operations/ListPrices.php index 7452266..73bb715 100644 --- a/src/Resources/Prices/Operations/ListPrices.php +++ b/src/Resources/Prices/Operations/ListPrices.php @@ -23,13 +23,13 @@ class ListPrices implements HasParameters * @throws InvalidArgumentException If includes, ids, statuses or taxCategories contain the incorrect type */ public function __construct( - private readonly ?Pager $pager = null, + private readonly Pager|null $pager = null, private readonly array $includes = [], private readonly array $ids = [], private readonly array $types = [], private readonly array $productIds = [], private readonly array $statuses = [], - private readonly ?bool $recurring = null, + private readonly bool|null $recurring = null, ) { if ($invalid = array_filter($this->includes, fn ($value): bool => ! $value instanceof Includes)) { throw InvalidArgumentException::arrayContainsInvalidTypes('includes', Includes::class, implode(', ', $invalid)); diff --git a/src/Resources/Prices/Operations/UpdatePrice.php b/src/Resources/Prices/Operations/UpdatePrice.php index ba64ef9..9bb40ba 100644 --- a/src/Resources/Prices/Operations/UpdatePrice.php +++ b/src/Resources/Prices/Operations/UpdatePrice.php @@ -24,16 +24,16 @@ class UpdatePrice implements \JsonSerializable */ public function __construct( public readonly string|Undefined $description = new Undefined(), - public readonly string|null|Undefined $name = new Undefined(), + public readonly string|Undefined|null $name = new Undefined(), public readonly CatalogType|Undefined $type = new Undefined(), - public readonly TimePeriod|null|Undefined $billingCycle = new Undefined(), - public readonly TimePeriod|null|Undefined $trialPeriod = new Undefined(), + public readonly TimePeriod|Undefined|null $billingCycle = new Undefined(), + public readonly TimePeriod|Undefined|null $trialPeriod = new Undefined(), public readonly TaxMode|Undefined $taxMode = new Undefined(), public readonly Money|Undefined $unitPrice = new Undefined(), public readonly array|Undefined $unitPriceOverrides = new Undefined(), public readonly PriceQuantity|Undefined $quantity = new Undefined(), public readonly Status|Undefined $status = new Undefined(), - public readonly CustomData|null|Undefined $customData = new Undefined(), + public readonly CustomData|Undefined|null $customData = new Undefined(), ) { } diff --git a/src/Resources/PricingPreviews/Operations/PreviewPrice.php b/src/Resources/PricingPreviews/Operations/PreviewPrice.php index 0728e0d..31773cb 100644 --- a/src/Resources/PricingPreviews/Operations/PreviewPrice.php +++ b/src/Resources/PricingPreviews/Operations/PreviewPrice.php @@ -19,13 +19,13 @@ class PreviewPrice implements \JsonSerializable */ public function __construct( public readonly array $items, - public readonly string|null|Undefined $customerId = new Undefined(), - public readonly string|null|Undefined $addressId = new Undefined(), - public readonly string|null|Undefined $businessId = new Undefined(), + public readonly string|Undefined|null $customerId = new Undefined(), + public readonly string|Undefined|null $addressId = new Undefined(), + public readonly string|Undefined|null $businessId = new Undefined(), public readonly CurrencyCode|Undefined $currencyCode = new Undefined(), - public readonly string|null|Undefined $discountId = new Undefined(), - public readonly AddressPreview|null|Undefined $address = new Undefined(), - public readonly string|null|Undefined $customerIpAddress = new Undefined(), + public readonly string|Undefined|null $discountId = new Undefined(), + public readonly AddressPreview|Undefined|null $address = new Undefined(), + public readonly string|Undefined|null $customerIpAddress = new Undefined(), ) { } diff --git a/src/Resources/Products/Operations/CreateProduct.php b/src/Resources/Products/Operations/CreateProduct.php index 542c661..e7c037c 100644 --- a/src/Resources/Products/Operations/CreateProduct.php +++ b/src/Resources/Products/Operations/CreateProduct.php @@ -17,10 +17,10 @@ class CreateProduct implements \JsonSerializable public function __construct( public readonly string $name, public readonly TaxCategory $taxCategory, - public readonly CatalogType|null|Undefined $type = new Undefined(), - public readonly string|null|Undefined $description = new Undefined(), - public readonly string|null|Undefined $imageUrl = new Undefined(), - public readonly CustomData|null|Undefined $customData = new Undefined(), + public readonly CatalogType|Undefined|null $type = new Undefined(), + public readonly string|Undefined|null $description = new Undefined(), + public readonly string|Undefined|null $imageUrl = new Undefined(), + public readonly CustomData|Undefined|null $customData = new Undefined(), ) { } diff --git a/src/Resources/Products/Operations/ListProducts.php b/src/Resources/Products/Operations/ListProducts.php index d682c63..5b4d68c 100644 --- a/src/Resources/Products/Operations/ListProducts.php +++ b/src/Resources/Products/Operations/ListProducts.php @@ -24,7 +24,7 @@ class ListProducts implements HasParameters * @throws InvalidArgumentException */ public function __construct( - private readonly ?Pager $pager = null, + private readonly Pager|null $pager = null, private readonly array $includes = [], private readonly array $ids = [], private readonly array $types = [], diff --git a/src/Resources/Products/Operations/UpdateProduct.php b/src/Resources/Products/Operations/UpdateProduct.php index 35ce035..82fbf21 100644 --- a/src/Resources/Products/Operations/UpdateProduct.php +++ b/src/Resources/Products/Operations/UpdateProduct.php @@ -17,11 +17,11 @@ class UpdateProduct implements \JsonSerializable public function __construct( public readonly string|Undefined $name = new Undefined(), - public readonly string|null|Undefined $description = new Undefined(), - public readonly CatalogType|null|Undefined $type = new Undefined(), + public readonly string|Undefined|null $description = new Undefined(), + public readonly CatalogType|Undefined|null $type = new Undefined(), public readonly TaxCategory|Undefined $taxCategory = new Undefined(), - public readonly string|null|Undefined $imageUrl = new Undefined(), - public readonly CustomData|null|Undefined $customData = new Undefined(), + public readonly string|Undefined|null $imageUrl = new Undefined(), + public readonly CustomData|Undefined|null $customData = new Undefined(), public readonly Status|Undefined $status = new Undefined(), ) { } diff --git a/src/Resources/Reports/Operations/ListReports.php b/src/Resources/Reports/Operations/ListReports.php index 0fde3de..a0a2cb3 100644 --- a/src/Resources/Reports/Operations/ListReports.php +++ b/src/Resources/Reports/Operations/ListReports.php @@ -17,7 +17,7 @@ class ListReports implements HasParameters * @throws InvalidArgumentException */ public function __construct( - private readonly ?Pager $pager = null, + private readonly Pager|null $pager = null, private readonly array $statuses = [], ) { if ($invalid = array_filter($this->statuses, fn ($value): bool => ! $value instanceof ReportStatus)) { diff --git a/src/Resources/Shared/Operations/List/DateComparison.php b/src/Resources/Shared/Operations/List/DateComparison.php index d3fec5d..18c47b8 100644 --- a/src/Resources/Shared/Operations/List/DateComparison.php +++ b/src/Resources/Shared/Operations/List/DateComparison.php @@ -10,7 +10,7 @@ class DateComparison { public function __construct( public readonly \DateTimeInterface $date, - public readonly ?Comparator $comparator = null, + public readonly Comparator|null $comparator = null, ) { } diff --git a/src/Resources/Shared/Operations/List/Pager.php b/src/Resources/Shared/Operations/List/Pager.php index dc373be..16af566 100644 --- a/src/Resources/Shared/Operations/List/Pager.php +++ b/src/Resources/Shared/Operations/List/Pager.php @@ -8,7 +8,7 @@ class Pager implements HasParameters { - public function __construct(private readonly ?string $after = null, private ?OrderBy $orderBy = null, private readonly int $perPage = 50) + public function __construct(private readonly string|null $after = null, private OrderBy|null $orderBy = null, private readonly int $perPage = 50) { $this->orderBy ??= OrderBy::idAscending(); } diff --git a/src/Resources/Subscriptions/Operations/ListSubscriptions.php b/src/Resources/Subscriptions/Operations/ListSubscriptions.php index 5ee113a..44b3c6a 100644 --- a/src/Resources/Subscriptions/Operations/ListSubscriptions.php +++ b/src/Resources/Subscriptions/Operations/ListSubscriptions.php @@ -22,9 +22,9 @@ class ListSubscriptions implements HasParameters * @param array $statuses */ public function __construct( - private readonly ?Pager $pager = null, + private readonly Pager|null $pager = null, private readonly array $addressIds = [], - private readonly ?CollectionMode $collectionMode = null, + private readonly CollectionMode|null $collectionMode = null, private readonly array $customerIds = [], private readonly array $ids = [], private readonly array $priceIds = [], diff --git a/src/Resources/Subscriptions/Operations/PreviewUpdateSubscription.php b/src/Resources/Subscriptions/Operations/PreviewUpdateSubscription.php index 5402016..fb7c6e8 100644 --- a/src/Resources/Subscriptions/Operations/PreviewUpdateSubscription.php +++ b/src/Resources/Subscriptions/Operations/PreviewUpdateSubscription.php @@ -26,15 +26,15 @@ class PreviewUpdateSubscription implements \JsonSerializable public function __construct( public readonly string|Undefined $customerId = new Undefined(), public readonly string|Undefined $addressId = new Undefined(), - public readonly string|null|Undefined $businessId = new Undefined(), + public readonly string|Undefined|null $businessId = new Undefined(), public readonly CurrencyCode|Undefined $currencyCode = new Undefined(), public readonly \DateTimeInterface|Undefined $nextBilledAt = new Undefined(), - public readonly SubscriptionDiscount|null|Undefined $discount = new Undefined(), + public readonly SubscriptionDiscount|Undefined|null $discount = new Undefined(), public readonly CollectionMode|Undefined $collectionMode = new Undefined(), - public readonly BillingDetails|null|Undefined $billingDetails = new Undefined(), - public readonly null|Undefined $scheduledChange = new Undefined(), + public readonly BillingDetails|Undefined|null $billingDetails = new Undefined(), + public readonly Undefined|null $scheduledChange = new Undefined(), public readonly array|Undefined $items = new Undefined(), - public readonly CustomData|null|Undefined $customData = new Undefined(), + public readonly CustomData|Undefined|null $customData = new Undefined(), public readonly SubscriptionProrationBillingMode|Undefined $prorationBillingMode = new Undefined(), public readonly SubscriptionOnPaymentFailure|Undefined $onPaymentFailure = new Undefined(), ) { diff --git a/src/Resources/Subscriptions/Operations/UpdateSubscription.php b/src/Resources/Subscriptions/Operations/UpdateSubscription.php index 52919d8..f332e8e 100644 --- a/src/Resources/Subscriptions/Operations/UpdateSubscription.php +++ b/src/Resources/Subscriptions/Operations/UpdateSubscription.php @@ -26,15 +26,15 @@ class UpdateSubscription implements \JsonSerializable public function __construct( public readonly string|Undefined $customerId = new Undefined(), public readonly string|Undefined $addressId = new Undefined(), - public readonly string|null|Undefined $businessId = new Undefined(), + public readonly string|Undefined|null $businessId = new Undefined(), public readonly CurrencyCode|Undefined $currencyCode = new Undefined(), public readonly \DateTimeInterface|Undefined $nextBilledAt = new Undefined(), - public readonly SubscriptionDiscount|null|Undefined $discount = new Undefined(), + public readonly SubscriptionDiscount|Undefined|null $discount = new Undefined(), public readonly CollectionMode|Undefined $collectionMode = new Undefined(), - public readonly BillingDetails|null|Undefined $billingDetails = new Undefined(), - public readonly null|Undefined $scheduledChange = new Undefined(), + public readonly BillingDetails|Undefined|null $billingDetails = new Undefined(), + public readonly Undefined|null $scheduledChange = new Undefined(), public readonly array|Undefined $items = new Undefined(), - public readonly CustomData|null|Undefined $customData = new Undefined(), + public readonly CustomData|Undefined|null $customData = new Undefined(), public readonly SubscriptionProrationBillingMode|Undefined $prorationBillingMode = new Undefined(), public readonly SubscriptionOnPaymentFailure|Undefined $onPaymentFailure = new Undefined(), ) { diff --git a/src/Resources/Transactions/Operations/CreateTransaction.php b/src/Resources/Transactions/Operations/CreateTransaction.php index 258914b..82587f8 100644 --- a/src/Resources/Transactions/Operations/CreateTransaction.php +++ b/src/Resources/Transactions/Operations/CreateTransaction.php @@ -26,16 +26,16 @@ class CreateTransaction implements \JsonSerializable public function __construct( public readonly array $items, public readonly StatusTransaction|Undefined $status = new Undefined(), - public readonly string|null|Undefined $customerId = new Undefined(), - public readonly string|null|Undefined $addressId = new Undefined(), - public readonly string|null|Undefined $businessId = new Undefined(), - public readonly CustomData|null|Undefined $customData = new Undefined(), + public readonly string|Undefined|null $customerId = new Undefined(), + public readonly string|Undefined|null $addressId = new Undefined(), + public readonly string|Undefined|null $businessId = new Undefined(), + public readonly CustomData|Undefined|null $customData = new Undefined(), public readonly CurrencyCode|Undefined $currencyCode = new Undefined(), public readonly CollectionMode|Undefined $collectionMode = new Undefined(), - public readonly string|null|Undefined $discountId = new Undefined(), - public readonly BillingDetails|null|Undefined $billingDetails = new Undefined(), - public readonly TransactionTimePeriod|null|Undefined $billingPeriod = new Undefined(), - public readonly Checkout|null|Undefined $checkout = new Undefined(), + public readonly string|Undefined|null $discountId = new Undefined(), + public readonly BillingDetails|Undefined|null $billingDetails = new Undefined(), + public readonly TransactionTimePeriod|Undefined|null $billingPeriod = new Undefined(), + public readonly Checkout|Undefined|null $checkout = new Undefined(), ) { } diff --git a/src/Resources/Transactions/Operations/ListTransactions.php b/src/Resources/Transactions/Operations/ListTransactions.php index b15b723..bd95a88 100644 --- a/src/Resources/Transactions/Operations/ListTransactions.php +++ b/src/Resources/Transactions/Operations/ListTransactions.php @@ -25,17 +25,17 @@ class ListTransactions implements HasParameters * @param array $origins */ public function __construct( - private readonly ?Pager $pager = null, - private readonly ?DateComparison $billedAt = null, - private readonly ?CollectionMode $collectionMode = null, - private readonly ?DateComparison $createdAt = null, + private readonly Pager|null $pager = null, + private readonly DateComparison|null $billedAt = null, + private readonly CollectionMode|null $collectionMode = null, + private readonly DateComparison|null $createdAt = null, private readonly array $customerIds = [], private readonly array $ids = [], private readonly array $includes = [], private readonly array $invoiceNumbers = [], private readonly array $statuses = [], private readonly array $subscriptionIds = [], - private readonly ?DateComparison $updatedAt = null, + private readonly DateComparison|null $updatedAt = null, private readonly array $origins = [], ) { if ($invalid = array_filter($this->customerIds, fn ($value): bool => ! is_string($value))) { diff --git a/src/Resources/Transactions/Operations/PreviewTransaction.php b/src/Resources/Transactions/Operations/PreviewTransaction.php index 93c4a7f..ab472a8 100644 --- a/src/Resources/Transactions/Operations/PreviewTransaction.php +++ b/src/Resources/Transactions/Operations/PreviewTransaction.php @@ -21,14 +21,14 @@ class PreviewTransaction implements \JsonSerializable */ public function __construct( public readonly array $items, - public readonly string|null|Undefined $customerId = new Undefined(), - public readonly string|null|Undefined $addressId = new Undefined(), - public readonly string|null|Undefined $businessId = new Undefined(), + public readonly string|Undefined|null $customerId = new Undefined(), + public readonly string|Undefined|null $addressId = new Undefined(), + public readonly string|Undefined|null $businessId = new Undefined(), public readonly CurrencyCode|Undefined $currencyCode = new Undefined(), public readonly CollectionMode|Undefined $collectionMode = new Undefined(), - public readonly string|null|Undefined $discountId = new Undefined(), - public readonly string|null|Undefined $customerIpAddress = new Undefined(), - public readonly AddressPreview|null|Undefined $address = new Undefined(), + public readonly string|Undefined|null $discountId = new Undefined(), + public readonly string|Undefined|null $customerIpAddress = new Undefined(), + public readonly AddressPreview|Undefined|null $address = new Undefined(), public readonly bool|Undefined $ignoreTrials = new Undefined(), ) { } diff --git a/src/Resources/Transactions/Operations/UpdateTransaction.php b/src/Resources/Transactions/Operations/UpdateTransaction.php index a35bf87..f77a9c2 100644 --- a/src/Resources/Transactions/Operations/UpdateTransaction.php +++ b/src/Resources/Transactions/Operations/UpdateTransaction.php @@ -24,17 +24,17 @@ class UpdateTransaction implements \JsonSerializable */ public function __construct( public readonly StatusTransaction|Undefined $status = new Undefined(), - public readonly string|null|Undefined $customerId = new Undefined(), - public readonly string|null|Undefined $addressId = new Undefined(), - public readonly string|null|Undefined $businessId = new Undefined(), - public readonly CustomData|null|Undefined $customData = new Undefined(), + public readonly string|Undefined|null $customerId = new Undefined(), + public readonly string|Undefined|null $addressId = new Undefined(), + public readonly string|Undefined|null $businessId = new Undefined(), + public readonly CustomData|Undefined|null $customData = new Undefined(), public readonly CurrencyCode|Undefined $currencyCode = new Undefined(), public readonly CollectionMode|Undefined $collectionMode = new Undefined(), - public readonly string|null|Undefined $discountId = new Undefined(), - public readonly BillingDetails|null|Undefined $billingDetails = new Undefined(), - public readonly TransactionTimePeriod|null|Undefined $billingPeriod = new Undefined(), + public readonly string|Undefined|null $discountId = new Undefined(), + public readonly BillingDetails|Undefined|null $billingDetails = new Undefined(), + public readonly TransactionTimePeriod|Undefined|null $billingPeriod = new Undefined(), public readonly array|Undefined $items = new Undefined(), - public readonly Checkout|null|Undefined $checkout = new Undefined(), + public readonly Checkout|Undefined|null $checkout = new Undefined(), ) { } diff --git a/src/ResponseParser.php b/src/ResponseParser.php index 0c0a4d1..9ccb61e 100644 --- a/src/ResponseParser.php +++ b/src/ResponseParser.php @@ -10,7 +10,7 @@ class ResponseParser { - private ?array $body = null; + private array|null $body = null; /** * @throws ApiError When the API response contains errors diff --git a/tests/Utils/ReadsFixtures.php b/tests/Utils/ReadsFixtures.php index a210f6a..3bfb982 100644 --- a/tests/Utils/ReadsFixtures.php +++ b/tests/Utils/ReadsFixtures.php @@ -14,7 +14,7 @@ public static function readJsonFixture(string $fixture): array return json_decode(self::readRawJsonFixture($fixture, $basePath), true, 512, JSON_THROW_ON_ERROR); } - public static function readRawJsonFixture(string $fixture, string $basePath = null): string + public static function readRawJsonFixture(string $fixture, string|null $basePath = null): string { if (! $basePath) { [$caller] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);