Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Add polyfills for PHPUnit 8 #6

Open
filips123 opened this issue Feb 25, 2019 · 3 comments
Open

Add polyfills for PHPUnit 8 #6

filips123 opened this issue Feb 25, 2019 · 3 comments

Comments

@filips123
Copy link

PHPUnit 8 has the return type declaration which is not compatible with older PHP and PHPUnit versions. There should be some polyfills for this.

See sebastianbergmann/phpunit#3543.

@keradus
Copy link
Member

keradus commented Feb 25, 2019

polyfill will not handle change of method prototype - eg explicit return typehint.

polyfill may add methods introduced in PHPUnit 8 to lower versions of PHPUnit.

@filips123
Copy link
Author

Is it possible to also overwrite methods?

@keradus
Copy link
Member

keradus commented Feb 26, 2019

yes, see https://github.com/PHPUnitGoodPractices/polyfill/blob/master/src/PolyfillTrait7.php#L21 for example
we always override, and then conditionally do polyfilling or pass to parent method, if it exists

of course, method header has to be compatible

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants