-
Notifications
You must be signed in to change notification settings - Fork 132
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
Adapter method ReflectionClass#getProperty()
throw an exception when a property doesn't exist
#391
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a BC break, so we will need to targeting it for 3.0 with an UPGRADE.md
entry.
@@ -184,7 +184,7 @@ public function getProperty($name) | |||
$betterReflectionProperty = $this->betterReflectionClass->getProperty($name); | |||
|
|||
if (null === $betterReflectionProperty) { | |||
return null; | |||
throw new CoreReflectionException(\sprintf('Property "%s" does not exist', $name)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return type hint should also be enforced, I suppose
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are currently no return type hints in adapters.
@@ -175,7 +175,7 @@ public function getProperty($name) | |||
$property = $this->betterReflectionObject->getProperty($name); | |||
|
|||
if (null === $property) { | |||
return null; | |||
throw new CoreReflectionException(\sprintf('Property "%s" does not exist', $name)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return type hint to be adde
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kukulich looks good, but needs a rebase :-\
@Ocramius Done. |
@kukulich thanks, waiting for CI |
🚢 |
Handles #389 |
ReflectionClass#getProperty()
throw an exception when a property doesn't exist
No description provided.