Skip to content

Ensure a leading backslash (and only one) is returned #737

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Ensure a leading backslash (and only one) is returned #737

wants to merge 2 commits into from

Conversation

bpolaszek
Copy link

... in the return type template.
Fixes #736

@Ocramius
Copy link
Member

@bpolaszek can you please add a test case that shows this behavior? An additional test asset should be sufficient.

Did you by chance/accident run the tests on PHP 7.1.0-beta3? That beta is broken...

@bpolaszek
Copy link
Author

bpolaszek commented Aug 24, 2016

@Ocramius Good catch, I was on PHP 7.1.0-beta3 indeed :)
I added an additionnal asset. The tests succeed on PHP 7.0.4 as well.

Btw, I don't think an additionnal test was needed now, since I thought only namespaced classes were impacted. Actually the tests couldn't run properly even with \stdClass.
This was indeed specific to PHP 7.1.0-beta3.

@@ -1032,6 +1032,6 @@ private function getMethodReturnType(\ReflectionMethod $method)
return ': \\' . $method->getDeclaringClass()->getParentClass()->getName();
}

return ': \\' . (string) $returnType;
return ': \\' . ltrim((string) $returnType, '\\');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests pass also without this change.

@Ocramius
Copy link
Member

Closing then: 7.1.0-beta3 is bugged as per http://marc.info/?t=147145076000010&r=1&w=2, php/php-src#2068 and other reported bugs.

We'll see how 7.1.0-RC1 goes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants