campaignmonitor / createsend-php

A PHP library for the Campaign Monitor API
http://campaignmonitor.github.io/createsend-php
Other
285 stars 106 forks source link

Issue with future PHP versions #45

Open kristofser opened 8 years ago

kristofser commented 8 years ago

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

ChuckHeintzelman commented 8 years ago

I'm running into this issue now

elliotchance commented 8 years ago

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

bjones2015 commented 8 years ago

+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.

bjones2015 commented 8 years ago

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.