Closed garak closed 3 years ago
I add PR - #492
Not before feature freeze at the very earliest
I think revisiting this after PHP 8.0.0 beta 1 and PHPUnit 9.3.0 has been tagged would be a good idea. We might actually be able to install all dependencies without ignoring platform-reqs at that point.
I think, that is 10th August, from memory.... something around that date anyway. ;)
that's what 'feature freeze' is :)
PHP 8 is feature-frozen and PHP 8.0.0 Beta 1 was released yesterday. Today PHPUnit 9.3.0 has been released.
@sebastianbergmann currently PHPUnit 9.3 cannot be installed under PHP 8.0 because phpspec/prophecy
does not allow it. I'm curious how phpunit 9.3 was released despite the fact that dependencies cannot be resolved at the moment. Have you built it under PHP 7.x?
Have you built it under PHP 7.x?
When can prophecy be released?
If anyone wants to jump in please do
Feedback on #495 will help
Review of #495 would be helpful to move forward
EDIT: my bad - had some old code lying around - once I got rid of this everything worked as expected. Apologies.
i don't know whether to create a new issue but there's an issue with creating doubles where the class has a parameter declared as mixed. In this case \Drupal\Core\Php8\Phpspec\Prophecy\ClassMirror::isNullable()
returns true because mixed allows null but null !== $this->getTypeHint($parameter)
. Then \Prophecy\Doubler\Generator\Node\TypeNodeAbstract::guardIsValidType()
throws an exception because
if (\PHP_VERSION_ID >= 80000 && isset($this->types['mixed']) && count($this->types) !== 1) {
throw new DoubleException('mixed cannot be part of a union');
}
I think the solution is to change isNullable() to
private function isNullable(ReflectionParameter $parameter)
{
$typehint = $this->getTypeHint($parameter);
return $parameter->allowsNull() && !(null === $typehint || 'mixed' === $typehint);
}
Because in PHP 8.0 nullable mixed types are not allowed. See https://php.watch/versions/8.0/mixed-type#nullable
Is there anything still blocking this?
Can we allow php 8 in composer.json? I see that some tests are already passing on travis