Skip to content

Commit

Permalink
Use native types where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
sprain committed Jul 11, 2024
1 parent cbf95db commit 4b2e80f
Show file tree
Hide file tree
Showing 29 changed files with 21 additions and 89 deletions.
3 changes: 1 addition & 2 deletions lib/SaferpayJson/Request/Container/A2a.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
final class A2a
{
/**
* @var string
* @SerializedName("AccountHolderName")
*/
private $accountHolderName;
private string $accountHolderName;

public function __construct(string $accountHolderName)
{
Expand Down
1 change: 0 additions & 1 deletion lib/SaferpayJson/Request/Container/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ final class Address
private ?\DateTime $dateOfBirth = null;

/**
* @var string|null
* @SerializedName("Street2")
*/
private ?string $street2 = null;
Expand Down
2 changes: 0 additions & 2 deletions lib/SaferpayJson/Request/Container/Amount.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
namespace Ticketpark\SaferpayJson\Request\Container;

use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Type;

final class Amount
{
/**
* @SerializedName("Value")
* @Type("integer")
*/
private int $value;

Expand Down
3 changes: 0 additions & 3 deletions lib/SaferpayJson/Request/Container/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Ticketpark\SaferpayJson\Request\Container;

use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Type;

final class Card
{
Expand All @@ -16,13 +15,11 @@ final class Card

/**
* @SerializedName("ExpYear")
* @Type("integer")
*/
private ?int $expYear = null;

/**
* @SerializedName("ExpMonth")
* @Type("integer")
*/
private ?int $expMonth = null;

Expand Down
6 changes: 0 additions & 6 deletions lib/SaferpayJson/Request/Container/ChosenPlan.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
namespace Ticketpark\SaferpayJson\Request\Container;

use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Type;

final class ChosenPlan
{
/**
* @SerializedName("NumberOfInstallments")
* @Type("int")
*/
private int $numberOfInstallments;

Expand All @@ -22,7 +20,6 @@ final class ChosenPlan

/**
* @SerializedName("InstallmentFee")
* @Type("Ticketpark\SaferpayJson\Request\Container\Amount")
*/
private ?Amount $installmentFee = null;

Expand All @@ -33,19 +30,16 @@ final class ChosenPlan

/**
* @SerializedName("FirstInstallmentAmount")
* @Type("Ticketpark\SaferpayJson\Request\Container\Amount")
*/
private ?Amount $firstInstallmentAmount = null;

/**
* @SerializedName("SubsequentInstallmentAmount")
* @Type("Ticketpark\SaferpayJson\Request\Container\Amount")
*/
private ?Amount $subsequentInstallmentAmount = null;

/**
* @SerializedName("TotalAmountDue")
* @Type("Ticketpark\SaferpayJson\Request\Container\Amount")
*/
private ?Amount $totalAmountDue = null;

Expand Down
3 changes: 0 additions & 3 deletions lib/SaferpayJson/Request/Container/IssuerReference.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,16 @@
namespace Ticketpark\SaferpayJson\Request\Container;

use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Type;

final class IssuerReference
{
/**
* @SerializedName("TransactionStamp")
* @Type("string")
*/
private string $transactionStamp;

/**
* @SerializedName("SettlementDate")
* @Type("string")
*/
private ?string $settlementDate = null;

Expand Down
2 changes: 0 additions & 2 deletions lib/SaferpayJson/Request/Container/Klarna.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
namespace Ticketpark\SaferpayJson\Request\Container;

use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Type;

final class Klarna
{
/**
* @SerializedName("Attachment")
* @Type("Ticketpark\SaferpayJson\Request\Container\Attachment")
*/
private Attachment $attachment;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
namespace Ticketpark\SaferpayJson\Request\Container;

use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Type;

final class MastercardIssuerInstallments
{
/**
* @SerializedName("ChosenPlan")
* @Type("Ticketpark\SaferpayJson\Request\Container\ChosenPlan")
*/
private ?ChosenPlan $chosenPlan = null;

Expand Down
4 changes: 2 additions & 2 deletions lib/SaferpayJson/Request/Container/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
final class Notification
{
/**
* @var array<string>|null
* @var array<string>
* @SerializedName("MerchantEmails")
*/
private ?array $merchantEmails = [];
Expand All @@ -23,7 +23,7 @@ final class Notification
* @var string|null
* @SerializedName("PayerDccReceiptEmail")
*/
private $payerDccReceiptEmail;
private ?string $payerDccReceiptEmail = null;

/**
* @var string|null
Expand Down
2 changes: 1 addition & 1 deletion lib/SaferpayJson/Request/Container/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
final class Order
{
/**
* @var array<OrderItem>|null
* @var array<OrderItem>
* @SerializedName("Items")
*/
private ?array $items = [];
Expand Down
3 changes: 0 additions & 3 deletions lib/SaferpayJson/Request/Container/Payer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Ticketpark\SaferpayJson\Request\Container;

use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Type;

final class Payer
{
Expand All @@ -25,13 +24,11 @@ final class Payer

/**
* @SerializedName("DeliveryAddress")
* @Type("Ticketpark\SaferpayJson\Request\Container\Address")
*/
private ?Address $deliveryAddress = null;

/**
* @SerializedName("BillingAddress")
* @Type("Ticketpark\SaferpayJson\Request\Container\Address")
*/
private ?Address $billingAddress = null;

Expand Down
10 changes: 0 additions & 10 deletions lib/SaferpayJson/Request/Container/PaymentMeans.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
namespace Ticketpark\SaferpayJson\Request\Container;

use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Type;

final class PaymentMeans
{
/**
* @SerializedName("Brand")
* @Type("Ticketpark\SaferpayJson\Request\Container\Brand")
*/
private ?Brand $brand = null;

Expand All @@ -27,49 +25,41 @@ final class PaymentMeans

/**
* @SerializedName("Card")
* @Type("Ticketpark\SaferpayJson\Request\Container\Card")
*/
private ?Card $card = null;

/**
* @SerializedName("BankAccount")
* @Type("Ticketpark\SaferpayJson\Request\Container\BankAccount")
*/
private ?BankAccount $bankAccount = null;

/**
* @SerializedName("Twint")
* @Type("Ticketpark\SaferpayJson\Request\Container\Twint")
*/
private ?Twint $twint = null;

/**
* @SerializedName("SaferpayFields")
* @Type("Ticketpark\SaferpayJson\Request\Container\SaferpayFields")
*/
private ?SaferpayFields $saferpayFields = null;

/**
* @SerializedName("Alias")
* @Type("Ticketpark\SaferpayJson\Request\Container\Alias")
*/
private ?Alias $alias = null;

/**
* @SerializedName("SchemeToken")
* @Type("Ticketpark\SaferpayJson\Request\Container\SchemeToken")
*/
private ?SchemeToken $schemeToken = null;

/**
* @SerializedName("ApplePay")
* @Type("Ticketpark\SaferpayJson\Request\Container\ApplePay")
*/
private ?ApplePay $applePay = null;

/**
* @SerializedName("GooglePay")
* @Type("Ticketpark\SaferpayJson\Request\Container\GooglePay")
*/
private ?GooglePay $googlePay = null;

Expand Down
4 changes: 0 additions & 4 deletions lib/SaferpayJson/Request/Container/PaymentMethodsOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,16 @@
namespace Ticketpark\SaferpayJson\Request\Container;

use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Type;

final class PaymentMethodsOptions
{
/**
* @var Ideal|null
* @SerializedName("Ideal")
* @Type("Ticketpark\SaferpayJson\Request\Container\Ideal")
*/
private ?Ideal $ideal = null;

/**
* @SerializedName("Klarna")
* @Type("Ticketpark\SaferpayJson\Request\Container\Klarna")
*/
private ?Klarna $klarna = null;

Expand Down
2 changes: 1 addition & 1 deletion lib/SaferpayJson/Request/Container/PendingNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
final class PendingNotification
{
/**
* @var array<string>|null
* @var array<string>
* @SerializedName("MerchantEmails")
*/
private ?array $merchantEmails = [];
Expand Down
4 changes: 1 addition & 3 deletions lib/SaferpayJson/Request/Container/Refund.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
namespace Ticketpark\SaferpayJson\Request\Container;

use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Type;

final class Refund
{
/**
* @SerializedName("Amount")
* @Type("Ticketpark\SaferpayJson\Request\Container\Amount")
*/
private ?Amount $amount = null;
private ?Amount $amount;

/**
* @SerializedName("OrderId")
Expand Down
2 changes: 0 additions & 2 deletions lib/SaferpayJson/Request/Container/RegisterAlias.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Ticketpark\SaferpayJson\Request\Container;

use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Type;

final class RegisterAlias
{
Expand All @@ -25,7 +24,6 @@ final class RegisterAlias

/**
* @SerializedName("Lifetime")
* @Type("integer")
*/
private ?int $lifetime = null;

Expand Down
4 changes: 2 additions & 2 deletions lib/SaferpayJson/Request/Container/RequestHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ final class RequestHeader
/**
* @SerializedName("RequestId")
*/
private ?string $requestId = null;
private ?string $requestId;

/**
* @SerializedName("RetryIndicator")
*/
private int $retryIndicator = 0;
private int $retryIndicator;

/**
* @SerializedName("ClientInfo")
Expand Down
3 changes: 1 addition & 2 deletions lib/SaferpayJson/Request/Container/ReturnUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
final class ReturnUrl
{
/**
* @var string
* @SerializedName("Url")
*/
private $url;
private string $url;

public function __construct(string $url)
{
Expand Down
5 changes: 1 addition & 4 deletions lib/SaferpayJson/Request/Container/RiskFactors.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Ticketpark\SaferpayJson\Request\Container;

use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Type;

final class RiskFactors
{
Expand All @@ -22,7 +21,6 @@ final class RiskFactors

/**
* @SerializedName("PayerProfile")
* @Type("Ticketpark\SaferpayJson\Request\Container\PayerProfile")
*/
private ?PayerProfile $payerProfile = null;

Expand All @@ -32,10 +30,9 @@ final class RiskFactors
private ?bool $isB2B = null;

/**
* @var string|null
* @SerializedName("DeviceFingerprintTransactionId")
*/
private $deviceFingerprintTransactionId;
private ?string $deviceFingerprintTransactionId = null;

public function getDeliveryType(): ?string
{
Expand Down
Loading

0 comments on commit 4b2e80f

Please sign in to comment.