Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix setter not being able to be set null (and ommited in serialization) #669

Merged
merged 2 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 0 additions & 49 deletions src/Adyen/Model/Checkout/AccountInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -587,9 +587,6 @@ public function getAccountAgeIndicator()
*/
public function setAccountAgeIndicator($accountAgeIndicator)
{
if (is_null($accountAgeIndicator)) {
throw new \InvalidArgumentException('non-nullable accountAgeIndicator cannot be null');
}
$allowedValues = $this->getAccountAgeIndicatorAllowableValues();
if (!in_array($accountAgeIndicator, $allowedValues, true)) {
throw new \InvalidArgumentException(
Expand Down Expand Up @@ -624,9 +621,6 @@ public function getAccountChangeDate()
*/
public function setAccountChangeDate($accountChangeDate)
{
if (is_null($accountChangeDate)) {
throw new \InvalidArgumentException('non-nullable accountChangeDate cannot be null');
}
$this->container['accountChangeDate'] = $accountChangeDate;

return $this;
Expand All @@ -651,9 +645,6 @@ public function getAccountChangeIndicator()
*/
public function setAccountChangeIndicator($accountChangeIndicator)
{
if (is_null($accountChangeIndicator)) {
throw new \InvalidArgumentException('non-nullable accountChangeIndicator cannot be null');
}
$allowedValues = $this->getAccountChangeIndicatorAllowableValues();
if (!in_array($accountChangeIndicator, $allowedValues, true)) {
throw new \InvalidArgumentException(
Expand Down Expand Up @@ -688,9 +679,6 @@ public function getAccountCreationDate()
*/
public function setAccountCreationDate($accountCreationDate)
{
if (is_null($accountCreationDate)) {
throw new \InvalidArgumentException('non-nullable accountCreationDate cannot be null');
}
$this->container['accountCreationDate'] = $accountCreationDate;

return $this;
Expand All @@ -715,9 +703,6 @@ public function getAccountType()
*/
public function setAccountType($accountType)
{
if (is_null($accountType)) {
throw new \InvalidArgumentException('non-nullable accountType cannot be null');
}
$allowedValues = $this->getAccountTypeAllowableValues();
if (!in_array($accountType, $allowedValues, true)) {
throw new \InvalidArgumentException(
Expand Down Expand Up @@ -752,7 +737,6 @@ public function getAddCardAttemptsDay()
*/
public function setAddCardAttemptsDay($addCardAttemptsDay)
{
// Do nothing for nullable integers
$this->container['addCardAttemptsDay'] = $addCardAttemptsDay;

return $this;
Expand All @@ -777,9 +761,6 @@ public function getDeliveryAddressUsageDate()
*/
public function setDeliveryAddressUsageDate($deliveryAddressUsageDate)
{
if (is_null($deliveryAddressUsageDate)) {
throw new \InvalidArgumentException('non-nullable deliveryAddressUsageDate cannot be null');
}
$this->container['deliveryAddressUsageDate'] = $deliveryAddressUsageDate;

return $this;
Expand All @@ -804,9 +785,6 @@ public function getDeliveryAddressUsageIndicator()
*/
public function setDeliveryAddressUsageIndicator($deliveryAddressUsageIndicator)
{
if (is_null($deliveryAddressUsageIndicator)) {
throw new \InvalidArgumentException('non-nullable deliveryAddressUsageIndicator cannot be null');
}
$allowedValues = $this->getDeliveryAddressUsageIndicatorAllowableValues();
if (!in_array($deliveryAddressUsageIndicator, $allowedValues, true)) {
throw new \InvalidArgumentException(
Expand Down Expand Up @@ -843,9 +821,6 @@ public function getHomePhone()
*/
public function setHomePhone($homePhone)
{
if (is_null($homePhone)) {
throw new \InvalidArgumentException('non-nullable homePhone cannot be null');
}
$this->container['homePhone'] = $homePhone;

return $this;
Expand All @@ -872,9 +847,6 @@ public function getMobilePhone()
*/
public function setMobilePhone($mobilePhone)
{
if (is_null($mobilePhone)) {
throw new \InvalidArgumentException('non-nullable mobilePhone cannot be null');
}
$this->container['mobilePhone'] = $mobilePhone;

return $this;
Expand All @@ -899,9 +871,6 @@ public function getPasswordChangeDate()
*/
public function setPasswordChangeDate($passwordChangeDate)
{
if (is_null($passwordChangeDate)) {
throw new \InvalidArgumentException('non-nullable passwordChangeDate cannot be null');
}
$this->container['passwordChangeDate'] = $passwordChangeDate;

return $this;
Expand All @@ -926,9 +895,6 @@ public function getPasswordChangeIndicator()
*/
public function setPasswordChangeIndicator($passwordChangeIndicator)
{
if (is_null($passwordChangeIndicator)) {
throw new \InvalidArgumentException('non-nullable passwordChangeIndicator cannot be null');
}
$allowedValues = $this->getPasswordChangeIndicatorAllowableValues();
if (!in_array($passwordChangeIndicator, $allowedValues, true)) {
throw new \InvalidArgumentException(
Expand Down Expand Up @@ -963,7 +929,6 @@ public function getPastTransactionsDay()
*/
public function setPastTransactionsDay($pastTransactionsDay)
{
// Do nothing for nullable integers
$this->container['pastTransactionsDay'] = $pastTransactionsDay;

return $this;
Expand All @@ -988,7 +953,6 @@ public function getPastTransactionsYear()
*/
public function setPastTransactionsYear($pastTransactionsYear)
{
// Do nothing for nullable integers
$this->container['pastTransactionsYear'] = $pastTransactionsYear;

return $this;
Expand All @@ -1013,9 +977,6 @@ public function getPaymentAccountAge()
*/
public function setPaymentAccountAge($paymentAccountAge)
{
if (is_null($paymentAccountAge)) {
throw new \InvalidArgumentException('non-nullable paymentAccountAge cannot be null');
}
$this->container['paymentAccountAge'] = $paymentAccountAge;

return $this;
Expand All @@ -1040,9 +1001,6 @@ public function getPaymentAccountIndicator()
*/
public function setPaymentAccountIndicator($paymentAccountIndicator)
{
if (is_null($paymentAccountIndicator)) {
throw new \InvalidArgumentException('non-nullable paymentAccountIndicator cannot be null');
}
$allowedValues = $this->getPaymentAccountIndicatorAllowableValues();
if (!in_array($paymentAccountIndicator, $allowedValues, true)) {
throw new \InvalidArgumentException(
Expand Down Expand Up @@ -1077,7 +1035,6 @@ public function getPurchasesLast6Months()
*/
public function setPurchasesLast6Months($purchasesLast6Months)
{
// Do nothing for nullable integers
$this->container['purchasesLast6Months'] = $purchasesLast6Months;

return $this;
Expand All @@ -1102,9 +1059,6 @@ public function getSuspiciousActivity()
*/
public function setSuspiciousActivity($suspiciousActivity)
{
if (is_null($suspiciousActivity)) {
throw new \InvalidArgumentException('non-nullable suspiciousActivity cannot be null');
}
$this->container['suspiciousActivity'] = $suspiciousActivity;

return $this;
Expand All @@ -1131,9 +1085,6 @@ public function getWorkPhone()
*/
public function setWorkPhone($workPhone)
{
if (is_null($workPhone)) {
throw new \InvalidArgumentException('non-nullable workPhone cannot be null');
}
$this->container['workPhone'] = $workPhone;

return $this;
Expand Down
48 changes: 0 additions & 48 deletions src/Adyen/Model/Checkout/AcctInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -587,9 +587,6 @@ public function getChAccAgeInd()
*/
public function setChAccAgeInd($chAccAgeInd)
{
if (is_null($chAccAgeInd)) {
throw new \InvalidArgumentException('non-nullable chAccAgeInd cannot be null');
}
$allowedValues = $this->getChAccAgeIndAllowableValues();
if (!in_array($chAccAgeInd, $allowedValues, true)) {
throw new \InvalidArgumentException(
Expand Down Expand Up @@ -624,9 +621,6 @@ public function getChAccChange()
*/
public function setChAccChange($chAccChange)
{
if (is_null($chAccChange)) {
throw new \InvalidArgumentException('non-nullable chAccChange cannot be null');
}
$this->container['chAccChange'] = $chAccChange;

return $this;
Expand All @@ -651,9 +645,6 @@ public function getChAccChangeInd()
*/
public function setChAccChangeInd($chAccChangeInd)
{
if (is_null($chAccChangeInd)) {
throw new \InvalidArgumentException('non-nullable chAccChangeInd cannot be null');
}
$allowedValues = $this->getChAccChangeIndAllowableValues();
if (!in_array($chAccChangeInd, $allowedValues, true)) {
throw new \InvalidArgumentException(
Expand Down Expand Up @@ -688,9 +679,6 @@ public function getChAccPwChange()
*/
public function setChAccPwChange($chAccPwChange)
{
if (is_null($chAccPwChange)) {
throw new \InvalidArgumentException('non-nullable chAccPwChange cannot be null');
}
$this->container['chAccPwChange'] = $chAccPwChange;

return $this;
Expand All @@ -715,9 +703,6 @@ public function getChAccPwChangeInd()
*/
public function setChAccPwChangeInd($chAccPwChangeInd)
{
if (is_null($chAccPwChangeInd)) {
throw new \InvalidArgumentException('non-nullable chAccPwChangeInd cannot be null');
}
$allowedValues = $this->getChAccPwChangeIndAllowableValues();
if (!in_array($chAccPwChangeInd, $allowedValues, true)) {
throw new \InvalidArgumentException(
Expand Down Expand Up @@ -752,9 +737,6 @@ public function getChAccString()
*/
public function setChAccString($chAccString)
{
if (is_null($chAccString)) {
throw new \InvalidArgumentException('non-nullable chAccString cannot be null');
}
$this->container['chAccString'] = $chAccString;

return $this;
Expand All @@ -779,9 +761,6 @@ public function getNbPurchaseAccount()
*/
public function setNbPurchaseAccount($nbPurchaseAccount)
{
if (is_null($nbPurchaseAccount)) {
throw new \InvalidArgumentException('non-nullable nbPurchaseAccount cannot be null');
}
$this->container['nbPurchaseAccount'] = $nbPurchaseAccount;

return $this;
Expand All @@ -806,9 +785,6 @@ public function getPaymentAccAge()
*/
public function setPaymentAccAge($paymentAccAge)
{
if (is_null($paymentAccAge)) {
throw new \InvalidArgumentException('non-nullable paymentAccAge cannot be null');
}
$this->container['paymentAccAge'] = $paymentAccAge;

return $this;
Expand All @@ -833,9 +809,6 @@ public function getPaymentAccInd()
*/
public function setPaymentAccInd($paymentAccInd)
{
if (is_null($paymentAccInd)) {
throw new \InvalidArgumentException('non-nullable paymentAccInd cannot be null');
}
$allowedValues = $this->getPaymentAccIndAllowableValues();
if (!in_array($paymentAccInd, $allowedValues, true)) {
throw new \InvalidArgumentException(
Expand Down Expand Up @@ -870,9 +843,6 @@ public function getProvisionAttemptsDay()
*/
public function setProvisionAttemptsDay($provisionAttemptsDay)
{
if (is_null($provisionAttemptsDay)) {
throw new \InvalidArgumentException('non-nullable provisionAttemptsDay cannot be null');
}
$this->container['provisionAttemptsDay'] = $provisionAttemptsDay;

return $this;
Expand All @@ -897,9 +867,6 @@ public function getShipAddressUsage()
*/
public function setShipAddressUsage($shipAddressUsage)
{
if (is_null($shipAddressUsage)) {
throw new \InvalidArgumentException('non-nullable shipAddressUsage cannot be null');
}
$this->container['shipAddressUsage'] = $shipAddressUsage;

return $this;
Expand All @@ -924,9 +891,6 @@ public function getShipAddressUsageInd()
*/
public function setShipAddressUsageInd($shipAddressUsageInd)
{
if (is_null($shipAddressUsageInd)) {
throw new \InvalidArgumentException('non-nullable shipAddressUsageInd cannot be null');
}
$allowedValues = $this->getShipAddressUsageIndAllowableValues();
if (!in_array($shipAddressUsageInd, $allowedValues, true)) {
throw new \InvalidArgumentException(
Expand Down Expand Up @@ -961,9 +925,6 @@ public function getShipNameIndicator()
*/
public function setShipNameIndicator($shipNameIndicator)
{
if (is_null($shipNameIndicator)) {
throw new \InvalidArgumentException('non-nullable shipNameIndicator cannot be null');
}
$allowedValues = $this->getShipNameIndicatorAllowableValues();
if (!in_array($shipNameIndicator, $allowedValues, true)) {
throw new \InvalidArgumentException(
Expand Down Expand Up @@ -998,9 +959,6 @@ public function getSuspiciousAccActivity()
*/
public function setSuspiciousAccActivity($suspiciousAccActivity)
{
if (is_null($suspiciousAccActivity)) {
throw new \InvalidArgumentException('non-nullable suspiciousAccActivity cannot be null');
}
$allowedValues = $this->getSuspiciousAccActivityAllowableValues();
if (!in_array($suspiciousAccActivity, $allowedValues, true)) {
throw new \InvalidArgumentException(
Expand Down Expand Up @@ -1035,9 +993,6 @@ public function getTxnActivityDay()
*/
public function setTxnActivityDay($txnActivityDay)
{
if (is_null($txnActivityDay)) {
throw new \InvalidArgumentException('non-nullable txnActivityDay cannot be null');
}
$this->container['txnActivityDay'] = $txnActivityDay;

return $this;
Expand All @@ -1062,9 +1017,6 @@ public function getTxnActivityYear()
*/
public function setTxnActivityYear($txnActivityYear)
{
if (is_null($txnActivityYear)) {
throw new \InvalidArgumentException('non-nullable txnActivityYear cannot be null');
}
$this->container['txnActivityYear'] = $txnActivityYear;

return $this;
Expand Down
Loading