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

PHP 7.4 deprecates parent for classes without parent #20

Open
aanderson-msi opened this issue Jan 15, 2021 · 5 comments
Open

PHP 7.4 deprecates parent for classes without parent #20

aanderson-msi opened this issue Jan 15, 2021 · 5 comments

Comments

@aanderson-msi
Copy link

Line 32 of ATConfig.php:
if($n == '_ivars') { return parent::__get($n); }

However, the class is declared without a parent:

/**
 * Contains various service configuration parameters as class static variables.
 *
 * {@link AddressServiceSoap} and {@link TaxServiceSoap} read this file during initialization.
 *
 * @author    Avalara
 * @copyright © 2004 - 2011 Avalara, Inc.  All rights reserved.
 * @package   Base
 */
namespace AvaTax;
class ATConfig
{

When using this class with PHP 7.4, it results in an error.

Deprecated Functionality: Cannot use "parent" when current class scope has no parent in <project>/vendor/avalara/avatax/AvaTax/ATConfig.php on line 32

Recommend returning "null" instead of the call to the parent's __get() function.

@vipinroy
Copy link

Any update on this issue?

@jonathanribas
Copy link

We can't move forward on PHP upgrades because of this issue.

PHP 7.3 will be deprecated at the of this year, can you please update your code?

@gusdemayo
Copy link

I opened a pull request that should fix this issue

By removing the line

if($n == '_ivars') { return parent::__get($n); }

the case of $n === 'ivars' should be caught by the else statement

@jonathanribas
Copy link

Thank you @gusdemayo! I was creating a PR with the exact same change!

@gusdemayo
Copy link

Is this project still being maintained?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants