This repository was archived by the owner on Feb 21, 2025. It is now read-only.

Description
Interfaces that contains methods with default parameters as mixed, breaks the generated code.
HHVM Reflection generate a HH\mixed value, but HHVM does not recognizes this
type as a mixed value, like HH\bool, HH\string, etc.
Test code:
use function Usox\HackMock\{mock, prospect};
interface InterfaceWithDefaultInput {
public function mixedWithoutDefault(mixed $input): void;
}
class InterfaceWithDefaultInputTest extends \Usox\HackMock\HackMock {
public function testWithDefault(): void {
$stub = mock(InterfaceWithDefaultInput::class);
prospect($stub, 'mixedWithoutDefault')->execute(vec['foo']);
}
}
I think replacing value on-fly is a quick patch, but using Reflection (maybe custom reflection classes) or a Builder (for types) should be a better solution 🤔.