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

support PHP8 #10

Merged
merged 4 commits into from Jan 28, 2021
Merged

support PHP8 #10

merged 4 commits into from Jan 28, 2021

Conversation

sj-i
Copy link
Contributor

@sj-i sj-i commented Jan 27, 2021

Currently, this PR is not compatible with older versions of PHP.
PHP8 introduces some BC breaks, so supporting both PHP7 and PHP8 in a single code base is no simple task.
The purpose of this PR is to first ask the author about his plans for PHP8.

The choices I can think of are:

a. bump the major to v2 and abandon the support for PHP7
b. bump the major to v2 and continue to support PHP7 in the v1 branch
c. support both versions in a single code base by switching class definitions with phpversion()

The following examples will show you why it is difficult to support both PHP7 and PHP8 in the same class definition.

Changes in this PR

Method signatures

Exceptions

  • Change exceptions thrown to sync with PHP8

phpunit

psalm

@sj-i sj-i changed the title support PHP8, currently not backward compatible with earlier PHP vers… support PHP8 Jan 27, 2021
src/PDOAdapter.php Outdated Show resolved Hide resolved
…ions.

# method signatures
- sync signatures of PDO methods with PHP8
	- PHP8 has named parameters, so also names of parameters should be compatible with parent
- change Exception thrown to sync with PHP8

# phpunit
- at() was deprecated as of phpunit9.3, so added a polyfill to avoid warnings for now. sebastianbergmann/phpunit#4297
- assertInternalType() was removed in phpunit9. sebastianbergmann/phpunit#3370
- setUp() and tearDown() have return type declaration of void as of phpunit8. sebastianbergmann/phpunit#3288
- @ExpectedException was removed in phpunit9. sebastianbergmann/phpunit#3333
This commit should be reverted when the next version of psalm is released.
@emonkak
Copy link
Owner

emonkak commented Jan 27, 2021

Please execute php-cs-fixer to fix coding styles.

- remove redundant @params in phpdocs
- migrate mixed from phpdocs to native type declaration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants