Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Support PHP 8.0 #926

Merged
merged 4 commits into from
Nov 22, 2020
Merged

[TASK] Support PHP 8.0 #926

merged 4 commits into from
Nov 22, 2020

Conversation

JakeQZ
Copy link
Contributor

@JakeQZ JakeQZ commented Nov 20, 2020

Resolves #925.

@JakeQZ JakeQZ added this to the 5.0.0 milestone Nov 20, 2020
@JakeQZ JakeQZ self-assigned this Nov 20, 2020
@JakeQZ
Copy link
Contributor Author

JakeQZ commented Nov 20, 2020

Blocked by #924 at present, but will hopefully enough here to give insight as to whether there is anything else we need to do or fix.

@JakeQZ JakeQZ added the blocked label Nov 20, 2020
@JakeQZ
Copy link
Contributor Author

JakeQZ commented Nov 20, 2020

Lint passes, at least, and the checks seem to run fine against whatever RC/beta version is currently deployed by GitHub.

JakeQZ added a commit that referenced this pull request Nov 20, 2020
@JakeQZ
Copy link
Contributor Author

JakeQZ commented Nov 20, 2020

Ah, but we need to update slevomat/coding-standard (even though it is only used by the Sniffer against PHP 7.3, Composer requires all development dependencies to be compatible with all development tools), and this requires finding whatever replaced SlevomatCodingStandard.TypeHints.TypeHintDeclaration.

@JakeQZ JakeQZ marked this pull request as draft November 20, 2020 00:56
@JakeQZ
Copy link
Contributor Author

JakeQZ commented Nov 20, 2020

That's now resolved, but the phpunit.phar file needs updating. However, that won't work. There is no version of PHPUnit compatible with both PHP 8 and PHP 7.1. We need 7.x for PHP 7.1, but 9.x for PHP 8. Even dropping PHP 7.1 support won't help.

I think we need to revert back to Composer for PHPUnit (i.e. revert #894), unless there's a way for Phive to handle this situation?

@oliverklee
Copy link
Contributor

@JakeQZ I've tested whether Phive allows parallel installation of multiple PHPUnit versions: It doesn't. However, we could manually add a tools/phpunit-9.4.phar use that conditionally on the used PHP version. What do you think?

@JakeQZ
Copy link
Contributor Author

JakeQZ commented Nov 20, 2020

@JakeQZ I've tested whether Phive allows parallel installation of multiple PHPUnit versions: It doesn't. However, we could manually add a tools/phpunit-9.4.phar use that conditionally on the used PHP version. What do you think?

Can we not run phive update phpunit prior to running the tests, and have <phar name="phpunit" version="^7.5 || ^9.4" installed="7.5.20" location="./tools/phpunit.phar" copy="true"/> in phive.xml. Do we even need the .phar files in the repository at all (other than to speed up setting up the development environment)? Will PHIVE be installed and available to GitHub Actions or would there need to be a separate step to install it?

PS. The unit tests seem to complete without failure with PHPUnit 9.4, however there are a lot of warnings about deprecated assertion methods.

@JakeQZ
Copy link
Contributor Author

JakeQZ commented Nov 21, 2020

Now have a green build :))

@JakeQZ
Copy link
Contributor Author

JakeQZ commented Nov 21, 2020

Will make a separate PR for the changes for PHPUnit & PHIVE...

JakeQZ added a commit that referenced this pull request Nov 21, 2020
This is required to be able to test against PHP 8.  However, PHPUnit 9.x
requires PHP 7.3, so a different version of PHPUnit is required for different
testing environments.

The main change here is a step in the GitHub Action to conditionally update
PHPUnit via PHIVE for PHP >=7.3.  PHIVE does not yet have the ability for
conditional installs (see
phar-io/phive#295 (comment)) so the
script must check the PHP version before running the update.

PHIVE has also been added to the tools (self-referencing) as it is not available
by default to GitHub Actions.

Note: There are warnings from PHPUnit 9.x about use of deprecated `assert`
methods (which will be removed in PHPUnit 10.x).  However, these don't cause the
tests to fail, and the replacement methods are not available in PHPUnit 7.x
which is still required to test against PHP 7.1 and 7.2.

Part of #925/#926.
JakeQZ added a commit that referenced this pull request Nov 21, 2020
This is required to be able to test against PHP 8.  However, PHPUnit 9.x
requires PHP 7.3, so a different version of PHPUnit is required for different
testing environments.

The main change here is a step in the GitHub Action to conditionally update
PHPUnit via PHIVE for PHP >=7.3.  PHIVE does not yet have the ability for
conditional installs (see
phar-io/phive#295 (comment)) so the
script must check the PHP version before running the update.

PHIVE has also been added to the tools (self-referencing) as it is not available
by default to GitHub Actions.

Note: There are warnings from PHPUnit 9.x about use of deprecated `assert`
methods (which will be removed in PHPUnit 10.x).  However, these don't cause the
tests to fail, and the replacement methods are not available in PHPUnit 7.x
which is still required to test against PHP 7.1 and 7.2.

Part of #925/#926.
JakeQZ added a commit that referenced this pull request Nov 22, 2020
This is required to be able to test against PHP 8.  However, PHPUnit 9.x
requires PHP 7.3, so a different version of PHPUnit is required for different
testing environments.

The main change here is a step in the GitHub Action to conditionally update
PHPUnit via PHIVE for PHP >=7.3.  PHIVE does not yet have the ability for
conditional installs (see
phar-io/phive#295 (comment)) so the
script must check the PHP version before running the update.

PHIVE has also been added to the tools (self-referencing) as it is not available
by default to GitHub Actions.

Note: There are warnings from PHPUnit 9.x about use of deprecated `assert`
methods (which will be removed in PHPUnit 10.x).  However, these don't cause the
tests to fail, and the replacement methods are not available in PHPUnit 7.x
which is still required to test against PHP 7.1 and 7.2.

Part of #925/#926.
oliverklee pushed a commit that referenced this pull request Nov 22, 2020
This is required to be able to test against PHP 8.  However, PHPUnit 9.x
requires PHP 7.3, so a different version of PHPUnit is required for different
testing environments.

The main change here is a step in the GitHub Action to conditionally update
PHPUnit via PHIVE for PHP >=7.3.  PHIVE does not yet have the ability for
conditional installs (see
phar-io/phive#295 (comment)) so the
script must check the PHP version before running the update.

PHIVE has also been added to the tools (self-referencing) as it is not available
by default to GitHub Actions.

Note: There are warnings from PHPUnit 9.x about use of deprecated `assert`
methods (which will be removed in PHPUnit 10.x).  However, these don't cause the
tests to fail, and the replacement methods are not available in PHPUnit 7.x
which is still required to test against PHP 7.1 and 7.2.

Part of #925/#926.
This should have been dropped by the rebase.
@JakeQZ JakeQZ marked this pull request as ready for review November 22, 2020 17:26
@JakeQZ
Copy link
Contributor Author

JakeQZ commented Nov 22, 2020

This can be reviewed and merged now. Note that the linked issue to be resolved is #916 not #925 (the latter which I closed as a duplicate).

@oliverklee oliverklee merged commit 9aea3b5 into master Nov 22, 2020
@oliverklee oliverklee deleted the compat/php8 branch November 22, 2020 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support PHP 8
2 participants