phpspec / prophecy

Highly opinionated mocking framework for PHP 5.3+
MIT License
8.53k stars 242 forks source link

Check for ReflectionNamedType before asking for the type #490

Closed ciaranmcnulty closed 4 years ago

ciaranmcnulty commented 4 years ago

This fails when presented with a union type (cc @Ayesh)

stof commented 4 years ago

this still does not support UnionType, as it would remove the typehint entirely (which will break the generated child class)

ciaranmcnulty commented 4 years ago

Yes #482 for that right now; I was concentrating on getting the existing behaviours covered

ciaranmcnulty commented 4 years ago

@stof Huh actually this is not breaking the child class for union types. Because we're on 7.2 dropping the type hints doesn't cause an error (although we should ensure the child has the right hints of course)