ably / ably-php

PHP client library SDK for Ably realtime messaging service
https://ably.com/download
Apache License 2.0
49 stars 10 forks source link

Support PHP 8.0; Drop 5.6, 7.0 & 7.1 #96

Closed jdavid closed 3 years ago

jdavid commented 3 years ago

Add support for PHP 8.0

QuintinWillison commented 3 years ago

Added @kavalerov as a reviewer as he may have opinions on dropped runtime support.

kavalerov commented 3 years ago

I haven't tested the SDK itself, but change in supported versions looks right to me, yes.

owenpearson commented 3 years ago

For visibility - the change in supported versions here is in line with current PHP support

jdavid commented 3 years ago

To get the test suite working with PHP 8.0 we have to upgrade PHPUnit. Only versions 8 and 9 support PHP 8.0, see https://phpunit.de/supported-versions.html

Note that there are no changes to the src folder. So this version could work with PHP 5.6, 7.0 and 7.1, but the tests won't pass.

Breaking changes in PHPUnit require to update the test suite. So the tests either pass with PHP 8.0 or with the older versions, but not both.

PHP 5.6 error, see https://github.com/ably/ably-php/runs/2041202213?check_suite_focus=true

PHP Parse error:  syntax error, unexpected ':', expecting ';' or '{' in ...

PHP 7.0 error, see https://github.com/ably/ably-php/runs/2041202230?check_suite_focus=true

PHP Fatal error:  Uncaught TypeError: Return value of DebugTestListener::startTestSuite() must be an instance of void, none returned in ...

PHP 7.1 error, see https://github.com/ably/ably-php/runs/2041202249?check_suite_focus=true

PHP Fatal error:  Declaration of DebugTestListener::endTest(PHPUnit\Framework\Test $test, $time): void must be compatible with PHPUnit\Framework\TestListener::endTest(PHPUnit\Framework\Test $test, float $time): void in ...

While the commit is large, there are only a few changes that repeat through the test suite: