Skip to content
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

Merged
merged 2 commits into from Feb 3, 2018

Conversation

kukulich
Copy link
Collaborator

@kukulich kukulich commented Jan 2, 2018

No description provided.

Copy link
Member

@Ocramius Ocramius left a 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));
Copy link
Member

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

Copy link
Collaborator Author

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));
Copy link
Member

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

Copy link
Member

@Ocramius Ocramius left a 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 :-\

@kukulich
Copy link
Collaborator Author

kukulich commented Feb 3, 2018

@Ocramius Done.

@Ocramius
Copy link
Member

Ocramius commented Feb 3, 2018

@kukulich thanks, waiting for CI

@Ocramius Ocramius merged commit 6508ca8 into Roave:master Feb 3, 2018
@Ocramius
Copy link
Member

Ocramius commented Feb 3, 2018

🚢

@Ocramius
Copy link
Member

Ocramius commented Feb 3, 2018

Handles #389

@kukulich kukulich deleted the adapters branch February 3, 2018 14:50
@Ocramius Ocramius changed the title Method getProperty() of adapters should throw exception when property doesn't exist Adapter method ReflectionClass#getProperty() throw an exception when a property doesn't exist May 26, 2018
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.

None yet

3 participants