-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[PropertyAccess] Document usage of createPropertyAccessor args #6640
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
[PropertyAccess] Document usage of createPropertyAccessor args #6640
Conversation
Not sure that the failed test on travis is related. |
.. caution:: | ||
|
||
As you can see, the method will return ``null`` if the index does not exists. | ||
To make it throws an exception in case of invalid index, set the first argument |
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.
-To make it throws
+ To make it throw
(present infinitive)
eae275c
to
5dfc8b2
Compare
As you can see, the method will return ``null`` if the index does not exists. | ||
To make it throw an exception in case of invalid index, set the first argument | ||
:method:`PropertyAccess::createPropertyAccessor<Symfony\\Component\\PropertyAccess\\PropertyAccess::createPropertyAccessor()>` | ||
to true, e.g. ``PropertyAccess::createPropertyAccessor(true)``. |
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.
true in ticks? not sure
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.
Do you mean that I should wrap it in ````
chars? It's a mistake that I'll correct, thank's for catch it.
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.
thats what i meant, thank you!
a64bbc2
to
f65ad3a
Compare
…ss::createPropertyAccessor() (chalasr) This PR was squashed before being merged into the 3.2-dev branch (closes #18977). Discussion ---------- [PropertyAccess] Add missing arguments to PropertyAccess::createPropertyAccessor() | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | symfony/symfony-docs#6640 Actually, the recommended way to use the PropertyAccessor is to use `PropertyAccess::createPropertyAccessor`. The problem is that using this way, we can't specify that invalid indexes should throw an exception, and so when calling `PropertyAccessor::isReadable([], '[foo]')` it returns always true. It should be possible to make the exception thrown, plus the `PropertyAccessor::$throwExceptionOnInvalidIndex` already exists but is not used in `PropertyAccess::createPropertyAccessor`. Commits ------- 5ded804 [PropertyAccess] Add missing arguments to PropertyAccess::createPropertyAccessor()
…ss::createPropertyAccessor() (chalasr) This PR was squashed before being merged into the 3.2-dev branch (closes #18977). Discussion ---------- [PropertyAccess] Add missing arguments to PropertyAccess::createPropertyAccessor() | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | symfony/symfony-docs#6640 Actually, the recommended way to use the PropertyAccessor is to use `PropertyAccess::createPropertyAccessor`. The problem is that using this way, we can't specify that invalid indexes should throw an exception, and so when calling `PropertyAccessor::isReadable([], '[foo]')` it returns always true. It should be possible to make the exception thrown, plus the `PropertyAccessor::$throwExceptionOnInvalidIndex` already exists but is not used in `PropertyAccess::createPropertyAccessor`. Commits ------- 5ded804 [PropertyAccess] Add missing arguments to PropertyAccess::createPropertyAccessor()
The related PR has been merged (symfony/symfony#18977). |
33357dd
to
16738a5
Compare
Updated according to symfony/symfony#19040. |
Fix spelling typos Formatting/Spelling fixes Document features enabling from createPropertyAccessor() wording
16738a5
to
34bc5a6
Compare
Closing as symfony/symfony#18977 has been reverted. |
This documents symfony/symfony#18977 (on hold).
Suggestions to make it better would be really appreciated.