Prophecy\Exception\Prophecy\MethodProphecyException: Cannot create a return value for the method as the type "static" is not supported. Configure an explicit return value instead.
Code:
class Process implements \IteratorAggregate
{
public function mustRun(?callable $callback = null, array $env = []): static
{
return $this;
}
}
When attempting to mock a method with a
static
return type (see https://php.watch/versions/8.0/static-return-type), then you'll get this error:Code: