Skip to content
Open
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
6 changes: 3 additions & 3 deletions src/Adyen/Model/BalanceControl/BalanceTransferRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -492,11 +492,11 @@ public function setType($type)
{
$allowedValues = $this->getTypeAllowableValues();
if (!in_array($type, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'type', must be one of '%s'",
"type: unexpected enum value '%s' - Supported values are [%s]",
$type,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
Comment on lines +495 to 501

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Replacing throw new \InvalidArgumentException with error_log is a significant degradation in error handling. By only logging an error and not throwing an exception, the application allows an invalid value to be set for the type property. This can lead to objects being in an invalid state, causing subtle bugs that are hard to debug later. The previous behavior of throwing an exception was correct as it enforces data integrity and fails fast. This pattern is repeated across many files in this pull request and should be reverted everywhere.

            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'type', must be one of '%s'",
                    $type,
                    implode("', '", $allowedValues)
                )
            );

}
Expand Down
12 changes: 6 additions & 6 deletions src/Adyen/Model/BalanceControl/BalanceTransferResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -573,11 +573,11 @@ public function setStatus($status)
{
$allowedValues = $this->getStatusAllowableValues();
if (!in_array($status, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'status', must be one of '%s'",
"status: unexpected enum value '%s' - Supported values are [%s]",
$status,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down Expand Up @@ -631,11 +631,11 @@ public function setType($type)
{
$allowedValues = $this->getTypeAllowableValues();
if (!in_array($type, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'type', must be one of '%s'",
"type: unexpected enum value '%s' - Supported values are [%s]",
$type,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Adyen/Model/Management/AccelInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,11 @@ public function setProcessingType($processingType)
{
$allowedValues = $this->getProcessingTypeAllowableValues();
if (!in_array($processingType, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'processingType', must be one of '%s'",
"processingType: unexpected enum value '%s' - Supported values are [%s]",
$processingType,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Adyen/Model/Management/AmexInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,11 +384,11 @@ public function setServiceLevel($serviceLevel)
{
$allowedValues = $this->getServiceLevelAllowableValues();
if (!in_array($serviceLevel, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'serviceLevel', must be one of '%s'",
"serviceLevel: unexpected enum value '%s' - Supported values are [%s]",
$serviceLevel,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Adyen/Model/Management/AndroidApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -531,11 +531,11 @@ public function setStatus($status)
{
$allowedValues = $this->getStatusAllowableValues();
if (!in_array($status, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'status', must be one of '%s'",
"status: unexpected enum value '%s' - Supported values are [%s]",
$status,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Adyen/Model/Management/Connectivity.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,11 @@ public function setSimcardStatus($simcardStatus)
{
$allowedValues = $this->getSimcardStatusAllowableValues();
if (!in_array($simcardStatus, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'simcardStatus', must be one of '%s'",
"simcardStatus: unexpected enum value '%s' - Supported values are [%s]",
$simcardStatus,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down
24 changes: 12 additions & 12 deletions src/Adyen/Model/Management/CreateCompanyWebhookRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -635,11 +635,11 @@ public function setCommunicationFormat($communicationFormat)
{
$allowedValues = $this->getCommunicationFormatAllowableValues();
if (!in_array($communicationFormat, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'communicationFormat', must be one of '%s'",
"communicationFormat: unexpected enum value '%s' - Supported values are [%s]",
$communicationFormat,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down Expand Up @@ -693,11 +693,11 @@ public function setEncryptionProtocol($encryptionProtocol)
{
$allowedValues = $this->getEncryptionProtocolAllowableValues();
if (!in_array($encryptionProtocol, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'encryptionProtocol', must be one of '%s'",
"encryptionProtocol: unexpected enum value '%s' - Supported values are [%s]",
$encryptionProtocol,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down Expand Up @@ -727,11 +727,11 @@ public function setFilterMerchantAccountType($filterMerchantAccountType)
{
$allowedValues = $this->getFilterMerchantAccountTypeAllowableValues();
if (!in_array($filterMerchantAccountType, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'filterMerchantAccountType', must be one of '%s'",
"filterMerchantAccountType: unexpected enum value '%s' - Supported values are [%s]",
$filterMerchantAccountType,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down Expand Up @@ -785,11 +785,11 @@ public function setNetworkType($networkType)
{
$allowedValues = $this->getNetworkTypeAllowableValues();
if (!in_array($networkType, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'networkType', must be one of '%s'",
"networkType: unexpected enum value '%s' - Supported values are [%s]",
$networkType,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down
18 changes: 9 additions & 9 deletions src/Adyen/Model/Management/CreateMerchantWebhookRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -590,11 +590,11 @@ public function setCommunicationFormat($communicationFormat)
{
$allowedValues = $this->getCommunicationFormatAllowableValues();
if (!in_array($communicationFormat, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'communicationFormat', must be one of '%s'",
"communicationFormat: unexpected enum value '%s' - Supported values are [%s]",
$communicationFormat,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down Expand Up @@ -648,11 +648,11 @@ public function setEncryptionProtocol($encryptionProtocol)
{
$allowedValues = $this->getEncryptionProtocolAllowableValues();
if (!in_array($encryptionProtocol, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'encryptionProtocol', must be one of '%s'",
"encryptionProtocol: unexpected enum value '%s' - Supported values are [%s]",
$encryptionProtocol,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down Expand Up @@ -682,11 +682,11 @@ public function setNetworkType($networkType)
{
$allowedValues = $this->getNetworkTypeAllowableValues();
if (!in_array($networkType, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'networkType', must be one of '%s'",
"networkType: unexpected enum value '%s' - Supported values are [%s]",
$networkType,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Adyen/Model/Management/DinersInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,11 @@ public function setServiceLevel($serviceLevel)
{
$allowedValues = $this->getServiceLevelAllowableValues();
if (!in_array($serviceLevel, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'serviceLevel', must be one of '%s'",
"serviceLevel: unexpected enum value '%s' - Supported values are [%s]",
$serviceLevel,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Adyen/Model/Management/InstallAndroidAppDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,11 @@ public function setType($type)
{
$allowedValues = $this->getTypeAllowableValues();
if (!in_array($type, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'type', must be one of '%s'",
"type: unexpected enum value '%s' - Supported values are [%s]",
$type,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,11 @@ public function setType($type)
{
$allowedValues = $this->getTypeAllowableValues();
if (!in_array($type, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'type', must be one of '%s'",
"type: unexpected enum value '%s' - Supported values are [%s]",
$type,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Adyen/Model/Management/JCBInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,11 @@ public function setServiceLevel($serviceLevel)
{
$allowedValues = $this->getServiceLevelAllowableValues();
if (!in_array($serviceLevel, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'serviceLevel', must be one of '%s'",
"serviceLevel: unexpected enum value '%s' - Supported values are [%s]",
$serviceLevel,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Adyen/Model/Management/KlarnaInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,11 @@ public function setRegion($region)
{
$allowedValues = $this->getRegionAllowableValues();
if (!in_array($region, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'region', must be one of '%s'",
"region: unexpected enum value '%s' - Supported values are [%s]",
$region,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Adyen/Model/Management/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,11 @@ public function setCategory($category)
{
$allowedValues = $this->getCategoryAllowableValues();
if (!in_array($category, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'category', must be one of '%s'",
"category: unexpected enum value '%s' - Supported values are [%s]",
$category,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Adyen/Model/Management/NyceInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,11 @@ public function setProcessingType($processingType)
{
$allowedValues = $this->getProcessingTypeAllowableValues();
if (!in_array($processingType, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'processingType', must be one of '%s'",
"processingType: unexpected enum value '%s' - Supported values are [%s]",
$processingType,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down
12 changes: 6 additions & 6 deletions src/Adyen/Model/Management/PayAtTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,11 +354,11 @@ public function setAuthenticationMethod($authenticationMethod)
{
$allowedValues = $this->getAuthenticationMethodAllowableValues();
if (!in_array($authenticationMethod, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'authenticationMethod', must be one of '%s'",
"authenticationMethod: unexpected enum value '%s' - Supported values are [%s]",
$authenticationMethod,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down Expand Up @@ -422,11 +422,11 @@ public function setPaymentInstrument($paymentInstrument)
}
$allowedValues = $this->getPaymentInstrumentAllowableValues();
if (!is_null($paymentInstrument) && !in_array($paymentInstrument, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'paymentInstrument', must be one of '%s'",
"paymentInstrument: unexpected enum value '%s' - Supported values are [%s]",
$paymentInstrument,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down
Loading