See for how to generate internal stubs for phan. The stubs should be generated using the PHP version that is our lowest requirement.