On Sat, Jul 9, 2016 at 4:16 PM, Aaron Piotrowski <aa...@trowski.com> wrote:
> > > > On Jul 9, 2016, at 8:17 AM, Levi Morrison <le...@php.net> wrote: > >> > > > > The final vote was 5 in favor and 8 against. This RFC has been rejected. > > > > While this RFC was rejected, ReflectionType::__toString() should still be > updated to include a ? for nullable types. This is a consequence of the > nullable types RFC. As mentioned in this RFC [1], the string representation > of ReflectionType should be a syntax-valid representation of the type. > Without adding ?, this will no longer be true. I do not view this as a BC > break. In fact, it is a BC break for PHPUnit, PHPSpec, and Mockery to not > make this change, as they currently depend on the string representation of > ReflectionType to generate code compatible with the parent class or > interface. > > Additionally, I propose adding a getName() method to ReflectionType that > returns only the name of the type, regardless of nullability. Casting > should not be required to get information from an object, but currently > this is the only way to get the type name from ReflectionType. Most other > reflection classes include a getName() method, this seems to have been an > oversight. > > Joe and Davey, what are your thoughts on this? > > Aaron Piotrowski > > [1] > https://wiki.php.net/rfc/reflectiontypeimprovements#backward_incompatible_changes > I agree with this suggestion. Nikita