AuthorizeNet / sample-code-php

This repository contains working code samples which demonstrate php integration with the Authorize.Net API
MIT License
175 stars 197 forks source link

PHP 7.4 Deprecation warnings #170

Closed RickKukiela closed 3 years ago

RickKukiela commented 3 years ago

Trying to build with the new 2.0.0 sdk against a php 7.4 box and I'm getting deprecation notices everywhere:

PHP Deprecated Warning 'yii\base\ErrorException' with message 'Cannot use "parent" when current class scope has no parent' 

in C:\Projects\premier\vendor\authorizenet\authorizenet\lib\net\authorize\api\contract\v1\MerchantAuthenticationType.php:291

This is just one example.

I tried changing return array_merge(parent::jsonSerialize(), $values); to return array_merge($this->jsonSerialize(), $values);

Which should work but just ends up causing an endless loop max nesting of 256 for the recursion. Didn't have time to keep futzing with it so I just disabled deprecation warnings for this controller.

Please update the sdk to be compatible with php 7.4

Thanks!

RickKukiela commented 3 years ago

Closing this because I meant to put this issue in the main repo.