I am running in the following two errors on my setup:

Deprecated function: Methods with the same name as their class will not be constructors in a future version of PHP; SofortLibLogger has a deprecated constructor in require_once() (line 36 of /home/.sites/882/site6321404/web/dev/sites/all/modules/commerce_sofortbanking/library/sofortLib.php).
Deprecated function: Methods with the same name as their class will not be constructors in a future version of PHP; PnagCustomer has a deprecated constructor in require_once() (line 4 of /home/.sites/882/site6321404/web/dev/sites/all/modules/commerce_sofortbanking/library/helper/class.abstract_document.inc.php).

I do not get this errors with PHP 5.6 - but I would really like to use PHP 7. Any plans on this being addressed?

Thank you for this module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

stylesuxx created an issue. See original summary.

drupov’s picture

Same for me.

Looking at the code at https://github.com/sofort/sofortlib-php, which is also what is referred by SOFORT themselves https://www.sofort.com/integrationCenter-eng-DE/integration/API-SDK#2861... I can see that the library there is not identical to what the module uses in under its' library subfolder.

The GitHub code is supposed to support PHP 7 (see the commits there), maybe the whole SDK changed after the Drupal module implementation.

jurgenhaas’s picture

Thanks for reporting this. It sounds as if you can still use this with PHP 7 as what you're getting is a deprecation hint for a future version of PHP. That means, it is still working but may not in one of the future PHP versions, most likely not before PHP 8.

The message you're seeing is "just" for information and in your production environment, that should not be vissible to your website visitors.

Now, with regard to potentially changing the library to resolve this deprecation information completely, I'm not sure what's the best approach. Replacing the library sounds like a really bad idea as we don't seem to have any budget to go through the whole module to make sure it is still working as before. Instead, for this simple matter it would probably be best, to patch the used library to make it fully PHP 7 compliant. Anyone around who can privde a patch for that?

drupov’s picture

Assigned: Unassigned » drupov
Status: Active » Needs review
FileSize
1.33 KB

Replacing the library at this point is definitely a huge thing.

As it is packaged with the module it might be enough to just replace/rename the method names that are the same as their class with the __contstruct method.

  • jurgenhaas committed c286d4d on 7.x-1.x
    Issue #2885884 by drupov: Problems on PHP 7
    
jurgenhaas’s picture

Status: Needs review » Fixed

@drupov thanks for your patch, I've just committed that to the dev release.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.