Skip to content

Commit 57acff3

Browse files
committed
Merge branch '4.3' into 4.4
* 4.3: [PropertyAccess] Update the method directives Tweaked the PropertyAccess doc Fixed method names when using the method directive
2 parents 145f28e + 5250be1 commit 57acff3

File tree

3 files changed

+20
-23
lines changed

3 files changed

+20
-23
lines changed

components/options_resolver.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ method::
748748

749749
When using an option deprecated by you in your own library, you can pass
750750
``false`` as the second argument of the
751-
:method:`Symfony\\Component\\OptionsResolver\\Options::offsetGet()` method
751+
:method:`Symfony\\Component\\OptionsResolver\\Options::offsetGet` method
752752
to not trigger the deprecation warning.
753753

754754
Instead of passing the message, you may also pass a closure which returns

components/property_access.rst

Lines changed: 14 additions & 17 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 = [
@@ -158,13 +158,13 @@ getters, this means that you can do something like this::
158158
$person = new Person();
159159

160160
if ($propertyAccessor->getValue($person, 'author')) {
161-
var_dump('He is an author');
161+
var_dump('This person is an author');
162162
}
163163
if ($propertyAccessor->getValue($person, 'children')) {
164-
var_dump('He has children');
164+
var_dump('This person has children');
165165
}
166166

167-
This will produce: ``He is an author``
167+
This will produce: ``This person is an author``
168168

169169
Accessing a non Existing Property Path
170170
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -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();

components/property_info.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ Extractable Information
120120
The :class:`Symfony\\Component\\PropertyInfo\\PropertyInfoExtractor`
121121
class exposes public methods to extract several types of information:
122122

123-
* :ref:`List of properties <property-info-list>`: :method:`Symfony\\Component\\PropertyInfo\\PropertyListExtractorInterface::getProperties()`
124-
* :ref:`Property type <property-info-type>`: :method:`Symfony\\Component\\PropertyInfo\\PropertyTypeExtractorInterface::getTypes()`
125-
* :ref:`Property description <property-info-description>`: :method:`Symfony\\Component\\PropertyInfo\\PropertyDescriptionExtractorInterface::getShortDescription()` and :method:`Symfony\\Component\\PropertyInfo\\PropertyDescriptionExtractorInterface::getLongDescription()`
126-
* :ref:`Property access details <property-info-access>`: :method:`Symfony\\Component\\PropertyInfo\\PropertyAccessExtractorInterface::isReadable()` and :method:`Symfony\\Component\\PropertyInfo\\PropertyAccessExtractorInterface::isWritable()`
127-
* :ref:`Property initializable through the constructor <property-info-initializable>`: :method:`Symfony\\Component\\PropertyInfo\\PropertyInitializableExtractorInterface::isInitializable()`
123+
* :ref:`List of properties <property-info-list>`: :method:`Symfony\\Component\\PropertyInfo\\PropertyListExtractorInterface::getProperties`
124+
* :ref:`Property type <property-info-type>`: :method:`Symfony\\Component\\PropertyInfo\\PropertyTypeExtractorInterface::getTypes`
125+
* :ref:`Property description <property-info-description>`: :method:`Symfony\\Component\\PropertyInfo\\PropertyDescriptionExtractorInterface::getShortDescription` and :method:`Symfony\\Component\\PropertyInfo\\PropertyDescriptionExtractorInterface::getLongDescription`
126+
* :ref:`Property access details <property-info-access>`: :method:`Symfony\\Component\\PropertyInfo\\PropertyAccessExtractorInterface::isReadable` and :method:`Symfony\\Component\\PropertyInfo\\PropertyAccessExtractorInterface::isWritable`
127+
* :ref:`Property initializable through the constructor <property-info-initializable>`: :method:`Symfony\\Component\\PropertyInfo\\PropertyInitializableExtractorInterface::isInitializable`
128128

129129
.. note::
130130

0 commit comments

Comments
 (0)