campaignmonitor/createsend-php

Issue with future PHP versions

Opened this issue · 4 comments

While fiddling around with the new PHP 7 Release Client, I encountered an issue, you might want to look into in the near future.

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

So in php-7 they will remove the option to create the constructor as a function with the same name as the class. If you still do it you will get a E_DEPRECATED.

So I would recommend you to use __construct(), since you will have less issues with this in the future.
You can read more here: https://wiki.php.net/rfc/remove_php4_constructors

I'm running into this issue now

Also while your at it you can remove the var keywords. This is now the public keyword for PHP 5+

+1 I upgraded to php 7 and now I'm getting

Methods with the same name as their class will not be constructors in a future version of PHP; CS_REST_Transactional_SmartEmail has a deprecated constructor

so now I cannot send emails.

I guess I should have looked at pull requests before +1ing that. There was a merge several days ago where a nice developer already took care of this. The pull request was merged, and six days ago the version was bumped to 5.0. I just updated my composer.json for this package to 5.* and now everything is working as expected.