Re: deprecated constructors
The constructor for a class would become just the generic:
__construct()
member.
But, need to also look through the code to see if there are/were specific calls to the member function ec_analytics other than declaring a new variable of that type.
If so, then it may be desirable to add a __construct() function above the existing function of the class' name and then have that function call the old constructor...
Sorry, digress a little.
Adding two underscores in front of the existing name won't resolve the usage issue.
Further note this format is becoming required in php 7.x but has been available since at least early php 5.x.
Re: deprecated constructors
OK, thanks for the info. I searched and don't see where any of the affected modules' methods are called so I changed them to __construct() and the notices have disappeared. This was in ec analytics, keep cart, search log and back in stock notifications observer classes. Since it's just a notice it's probably not worth updating the mods at this point.
Re: deprecated constructors
Quote:
Originally Posted by
lankeeyankee
Since it's just a notice it's probably not worth updating the mods at this point.
That is where i disagree with you. This IS the time to update, because now it is only a warning. in a next php version, that warning will become a fatal error, because the constructor is not allowed to be the same as the class name any more.
So you could see this as a friendly reminder of php to tell you it is time to change that piece of code. Don't wait until it is broken. :hug:
Re: deprecated constructors
OK, I will test it a bit on my dev 1.5.6b for a bit to see if anything else needs changing then will upload the updated packages. There are a few other notices that I don't really know how to correct, it's been so long since I've done anything beyond some basic changes that I have forgotten much. I will post the specific issues in the related threads to see if others can help solve the issues.