-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Property access #7870
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
Property access #7870
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.
👍 these fixes look good to me. Thanks!
components/property_access.rst
Outdated
|
||
public function setLastName($name) | ||
public function getLastName() | ||
{ | ||
$this->lastName = $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.
You should change this to return $this->lastName;
then.
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.
Thanks
components/property_access.rst
Outdated
|
||
public function setLastName($name) | ||
public function getLastName() |
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.
I don't understand this change. This section is about modifying objects not reading from them.
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.
I think this looks better.
components/property_access.rst
Outdated
|
||
public function getChildren() { | ||
return $this->children; | ||
} |
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.
I would move both methods between setLastName()
and __set()
. And to match the code style of the Symfony code the opening curly brace should be on its own line. However, we can easily make this change while merging your PR.
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.
looks good to me
This could be merged 👍 @javiereguiluz |
@iulyanp thanks a lot for contributing these fixes and congrats on your first Symfony Docs contribution. |
Hello,
I changed the visibility of the
$children
property and use thegetLastName
method in order for the example to work correctly.