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

Make library compatible with PHP 8.1 #439

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "authorizenet/authorizenet",
"type": "library",
"version": "2.0.2",
"version": "3.0.0",
"description": "Official PHP SDK for Authorize.Net",
"keywords": ["authorizenet", "authorize.net", "payment", "ecommerce"],
"license": "proprietary",
"homepage": "http://developer.authorize.net",
"require": {
"php": ">=5.6",
"php": "^8.1",

Choose a reason for hiding this comment

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

May I suggest removing this require? my guess is that previous versions of PHP will read the attribute as a comment, so no need to break compatibility

"ext-curl": "*",
"ext-json": "*"
},
Expand Down
4 changes: 3 additions & 1 deletion lib/net/authorize/api/contract/v1/ANetApiRequestType.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ public function setRefId($refId)


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
4 changes: 3 additions & 1 deletion lib/net/authorize/api/contract/v1/ANetApiResponseType.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ public function setSessionToken($sessionToken)


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ public function setSubscriptionId($subscriptionId)


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ public function setSubscription(\net\authorize\api\contract\v1\ARBSubscriptionTy


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ public function setPaging(\net\authorize\api\contract\v1\PagingType $paging)


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ public function setOrderDescending($orderDescending)


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ public function setIncludeTransactions($includeTransactions)


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ public function setSubscriptionId($subscriptionId)


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,9 @@ public function setArbTransactions(array $arbTransactions)


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
4 changes: 3 additions & 1 deletion lib/net/authorize/api/contract/v1/ARBSubscriptionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,9 @@ public function setProfile(\net\authorize\api\contract\v1\CustomerProfileIdType


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ public function setSubscription(\net\authorize\api\contract\v1\ARBSubscriptionTy


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
4 changes: 3 additions & 1 deletion lib/net/authorize/api/contract/v1/ArbTransactionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ public function setAttemptNum($attemptNum)


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
4 changes: 3 additions & 1 deletion lib/net/authorize/api/contract/v1/ArrayOfSettingType.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ public function setSetting(array $setting)


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
4 changes: 3 additions & 1 deletion lib/net/authorize/api/contract/v1/AuDeleteType.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ public function setCreditCard(\net\authorize\api\contract\v1\CreditCardMaskedTyp


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
4 changes: 3 additions & 1 deletion lib/net/authorize/api/contract/v1/AuDetailsType.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ public function setReasonDescription($reasonDescription)


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
4 changes: 3 additions & 1 deletion lib/net/authorize/api/contract/v1/AuResponseType.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ public function setReasonDescription($reasonDescription)


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
4 changes: 3 additions & 1 deletion lib/net/authorize/api/contract/v1/AuUpdateType.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ public function setOldCreditCard(\net\authorize\api\contract\v1\CreditCardMasked


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ class AuthenticateTestRequest extends ANetApiRequestType


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ public function setAuthorizationIndicator($authorizationIndicator)


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
4 changes: 3 additions & 1 deletion lib/net/authorize/api/contract/v1/BankAccountMaskedType.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ public function setBankName($bankName)


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
4 changes: 3 additions & 1 deletion lib/net/authorize/api/contract/v1/BankAccountType.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ public function setCheckNumber($checkNumber)


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
4 changes: 3 additions & 1 deletion lib/net/authorize/api/contract/v1/BatchDetailsType.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,9 @@ public function setStatistics(array $statistics)


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
4 changes: 3 additions & 1 deletion lib/net/authorize/api/contract/v1/BatchStatisticType.php
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,9 @@ public function setRefundReturnedItemsCount($refundReturnedItemsCount)


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
4 changes: 3 additions & 1 deletion lib/net/authorize/api/contract/v1/CardArtType.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ public function setCardType($cardType)


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
4 changes: 3 additions & 1 deletion lib/net/authorize/api/contract/v1/CcAuthenticationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ public function setCardholderAuthenticationValue($cardholderAuthenticationValue)


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
4 changes: 3 additions & 1 deletion lib/net/authorize/api/contract/v1/ContactDetailType.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ public function setLastName($lastName)


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ public function setValidationMode($validationMode)


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ public function setProfileType($profileType)


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ public function setValidationMode($validationMode)


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ public function setExtraOptions($extraOptions)


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ public function setDefaultShippingAddress($defaultShippingAddress)


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ public function setCustomerShippingAddressIdList(array $customerShippingAddressI


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ public function setTransactionRequest(\net\authorize\api\contract\v1\Transaction


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
4 changes: 3 additions & 1 deletion lib/net/authorize/api/contract/v1/CreditCardMaskedType.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ public function setIsPaymentToken($isPaymentToken)


// Json Serialize Code
public function jsonSerialize(){
#[\ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
Expand Down
Loading