8000 minor #12811 [PropertyAccess] Update the method directives (javieregu… · symfony/symfony-docs@b2f2e52 · GitHub
[go: up one dir, main page]

Skip to content

Commit b2f2e52

Browse files
committed
minor #12811 [PropertyAccess] Update the method directives (javiereguiluz)
This PR was merged into the 4.3 branch. Discussion ---------- [PropertyAccess] Update the method directives I don't understand the reasoning for using the `:method:` directives in this way. It makes docs more verbose, it complicates maintenance and it removes the trailing `()` from method names, which is essential to make them look like methods. Commits ------- fc44076 [PropertyAccess] Update the method directives
2 parents f89f521 + fc44076 commit b2f2e52

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

components/property_access.rst

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Usage
2121
-----
2222

2323
The entry point of this component is the
24-
:method:`PropertyAccess::createPropertyAccessor<Symfony\\Component\\PropertyAccess\\PropertyAccess::createPropertyAccessor>`
24+
:method:`Symfony\\Component\\PropertyAccess\\PropertyAccess::createPropertyAccessor`
2525
factory. This factory will create a new instance of the
2626
:class:`Symfony\\Component\\PropertyAccess\\PropertyAccessor` class with the
2727
default configuration::
@@ -34,8 +34,8 @@ Reading from Arrays
3434
-------------------
3535

3636
You can read an array with the
37-
:method:`PropertyAccessor::getValue<Symfony\\Component\\PropertyAccess\\PropertyAccessor::getValue>`
38-
method. This is done using the index notation that is used in PHP::
37+
:method:`Symfony\\Component\\PropertyAccess\\PropertyAccessor::getValue` method.
38+
This is done using the index notation that is used in PHP::
3939

4040
// ...
4141
$person = [
@@ -175,7 +175,7 @@ Accessing a non Existing Property Path
175175
Symfony 4.3.
176176

177177
By default a :class:`Symfony\\Component\\PropertyAccess\\Exception\\NoSuchPropertyException`
178-
is thrown if the property path passed to :method:`PropertyAccessor::getValue<Symfony\\Component\\PropertyAccess\\PropertyAccessor::getValue>`
178+
is thrown if the property path passed to :method:`Symfony\\Component\\PropertyAccess\\PropertyAccessor::getValue`
179179
does not exist. You can change this behavior using the
180180
:method:`Symfony\\Component\\PropertyAccess\\PropertyAccessorBuilder::disableExceptionOnInvalidPropertyPath`
181181
method::
@@ -259,16 +259,15 @@ enable this feature by using :class:`Symfony\\Component\\PropertyAccess\\Propert
259259
.. caution::
260260

261261
The ``__call()`` feature is disabled by default, you can enable it by calling
262-
:method:`PropertyAccessorBuilder::enableMagicCall<Symfony\\Component\\PropertyAccess\\PropertyAccessorBuilder::enableMagicCall>`
262+
:method:`Symfony\\Component\\PropertyAccess\\PropertyAccessorBuilder::enableMagicCall`
263263
see `Enable other Features`_.
264264

265265
Writing to Arrays
266266
-----------------
267267

268268
The ``PropertyAccessor`` class can do more than just read an array, it can
269269
also write to an array. This can be achieved using the
270-
:method:`PropertyAccessor::setValue<Symfony\\Component\\PropertyAccess\\PropertyAccessor::setValue>`
271-
method::
270+
:method:`Symfony\\Component\\PropertyAccess\\PropertyAccessor::setValue` method::
272271

273272
// ...
274273
$person = [];
@@ -404,20 +403,18 @@ Checking Property Paths
404403
-----------------------
405404

406405
When you want to check whether
407-
:method:`PropertyAccessor::getValue<Symfony\\Component\\PropertyAccess\\PropertyAccessor::getValue>`
408-
can safely be called without actually calling that method, you can use
409-
:method:`PropertyAccessor::isReadable<Symfony\\Component\\PropertyAccess\\PropertyAccessor::isReadable>`
410-
instead::
406+
:method:`Symfony\\Component\\PropertyAccess\\PropertyAccessor::getValue` can
407+
safely be called without actually calling that method, you can use
408+
:method:`Symfony\\Component\\PropertyAccess\\PropertyAccessor::isReadable` instead::
411409

412410
$person = new Person();
413411

414412
if ($propertyAccessor->isReadable($person, 'firstName')) {
415413
// ...
416414
}
417415

418-
The same is possible for :method:`PropertyAccessor::setValue<Symfony\\Component\\PropertyAccess\\PropertyAccessor::setValue>`:
419-
Call the
420-
:method:`PropertyAccessor::isWritable<Symfony\\Component\\PropertyAccess\\PropertyAccessor::isWritable>`
416+
The same is possible for :method:`Symfony\\Component\\PropertyAccess\\PropertyAccessor::setValue`:
417+
Call the :method:`Symfony\\Component\\PropertyAccess\\PropertyAccessor::isWritable`
421418
method to find out whether a property path can be updated::
422419

423420
$person = new Person();

0 commit comments

Comments
 (0)
0