roy-bongers / certbot-transip-dns-01-validator

Certbot DNS-01 validation for wildcard certificates (ACME-v2)
GNU General Public License v3.0
79 stars 15 forks source link

Methods with the same name as their class will not be constructors in a future version of PHP #5

Closed coret closed 5 years ago

coret commented 5 years ago

Problem:

Error output from auth-hook:

PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; DNSTypes has a deprecated constructor in ***/transip_api/dns.php on line 55
PHP Stack trace:
PHP   1. {main}() ***/transip_api/auth-hook:0
PHP   2. require_once() ***/transip_api/auth-hook:4

PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; DNSQuery has a deprecated constructor in ***/transip_api/dns.php on line 157
PHP Stack trace:
PHP   1. {main}() ***/transip_api/auth-hook:0
PHP   2. require_once() ***/transip_api/auth-hook:4

Error output from cleanup-hook:
PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; DNSTypes has a deprecated constructor in /home/http/ssl/transip_api/dns.php on line 55
PHP Stack trace:
PHP   1. {main}() /home/http/ssl/transip_api/cleanup-hook:0
PHP   2. require_once() /home/http/ssl/transip_api/cleanup-hook:4
PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; DNSQuery has a deprecated constructor in /home/http/ssl/transip_api/dns.php on line 157
PHP Stack trace:
PHP   1. {main}() /home/http/ssl/transip_api/cleanup-hook:0
PHP   2. require_once() /home/http/ssl/transip_api/cleanup-hook:4

Error output from cleanup-hook:

PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; DNSTypes has a deprecated constructor in ***/transip_api/dns.php on line 55
PHP Stack trace:
PHP   1. {main}() ***/transip_api/cleanup-hook:0
PHP   2. require_once() ***/transip_api/cleanup-hook:4
PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; DNSQuery has a deprecated constructor in ***/transip_api/dns.php on line 157
PHP Stack trace:
PHP   1. {main}() ***/transip_api/cleanup-hook:0
PHP   2. require_once() ***/transip_api/cleanup-hook:4

Cause: PHP 4 style constructors (methods that have the same name as the class they are defined in) are deprecated in PHP 7, and will be removed in the future.

Solution: Rename these methods in https://raw.githubusercontent.com/roy-bongers/certbot-transip-dns-01-validator/master/dns.php to __construct()

roy-bongers commented 5 years ago

Thank you for your feedback. I've made a new release (v1.1.0) which fixes this issue. It has been tested with PHP 7.2.17