Closed Ayesh closed 4 years ago
Related: phpspec/phpspec#1314
I’d like to get #476 merged which would then simplify this a lot 👍
That would he lovely! We can remove a lot of void
workarounds and always assume getType
is available. I'll wait for those PRs, and then rebase this PR after that.
Thank you.
Ok I merged it. I actually started a branch like this one but the complexity got too much for me so I did that other change :)
If you can rebase that looks good
For debugging in php8 I had similar issues and resorted to running in 7.4 for debug just to figure out where calls were coming from
Maybe split out the changes that are to get the existing suite paying, from changes to support new features (eg mixed hint)
The latter would need additional tests etc
Thanks a lot @ciaranmcnulty . I sent PR #478 to enable builds. We can either remove workarounds for PHP <7.2 first, and then work on PHP 8 fixes, or the other way around.
please also rebase this PR now that code for PHP < 7.2 has been removed.
Thanks a lot for the great feedback. I will rebase/update code with new minimum PHP version in mind and other changes.
I used version_compare()
because it was already being used in other areas, but I think breaking that convention is worth the dead code elimination improvements.
@stof I rebased and made some changes in the code, and with PHP 7.2 as the minimum, I could remove a lot of code. It would be great if you could take a look.
I this this PR is ready for merge now. It gets the ball rolling at least, even if it is not complete (just like the phpspec PR).
Thanks, @Ayesh!
Work in progress to bring PHP 8 support for prophecy.
Majority of the errors were deprecation notices. I fixed the optional-before-required errors and deprecation of
ReflectionParameter
methodsgetClass
,isCallable
, andisArray
with branching code that checksgetType
is available, and then uses it instead of the shorthand now-deprecated functions.I'm not completely sure about the fixes related to the new
mixed
type.After these changes, there are only 4 errors/failures remaining from PHPUnit:
I cannot get xdebug to work with PHP nightly builds, so these errors do not contain any backtraces. Any insights would be appreciated. I tried to skip some of the tests (such as
#2
above) with@require PHP <= 8
annotations for the test because the deprecated behavior is exactly what's this test is asserting.ReflectionParameter::export
method is deprecated, and removed in PHP 8, which causes#3
above.