Skip to content

Commit 5da0ab4

Browse files
committed
Merge branch '4.4' into 5.0
* 4.4: [PropertyAccess] Update the method directives Tweaked the PropertyAccess doc Fixed method names when using the method directive
2 parents 8066314 + 57acff3 commit 5da0ab4

File tree

3 files changed

+20
-23
lines changed

3 files changed

+20
-23
lines changed

Diff for: components/options_resolver.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ method::
744744

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

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

Diff for: components/property_access.rst

+14-17
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,19 +158,19 @@ 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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
171171

172172
By default a :class:`Symfony\\Component\\PropertyAccess\\Exception\\NoSuchPropertyException`
173-
is thrown if the property path passed to :method:`PropertyAccessor::getValue<Symfony\\Component\\PropertyAccess\\PropertyAccessor::getValue>`
173+
is thrown if the property path passed to :method:`Symfony\\Component\\PropertyAccess\\PropertyAccessor::getValue`
174174
does not exist. You can change this behavior using the
175175
:method:`Symfony\\Component\\PropertyAccess\\PropertyAccessorBuilder::disableExceptionOnInvalidPropertyPath`
176176
method::
@@ -254,16 +254,15 @@ enable this feature by using :class:`Symfony\\Component\\PropertyAccess\\Propert
254254
.. caution::
255255

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

260260
Writing to Arrays
261261
-----------------
262262

263263
The ``PropertyAccessor`` class can do more than just read an array, it can
264264
also write to an array. This can be achieved using the
265-
:method:`PropertyAccessor::setValue<Symfony\\Component\\PropertyAccess\\PropertyAccessor::setValue>`
266-
method::
265+
:method:`Symfony\\Component\\PropertyAccess\\PropertyAccessor::setValue` method::
267266

268267
// ...
269268
$person = [];
@@ -399,20 +398,18 @@ Checking Property Paths
399398
-----------------------
400399

401400
When you want to check whether
402-
:method:`PropertyAccessor::getValue<Symfony\\Component\\PropertyAccess\\PropertyAccessor::getValue>`
403-
can safely be called without actually calling that method, you can use
404-
:method:`PropertyAccessor::isReadable<Symfony\\Component\\PropertyAccess\\PropertyAccessor::isReadable>`
405-
instead::
401+
:method:`Symfony\\Component\\PropertyAccess\\PropertyAccessor::getValue` can
402+
safely be called without actually calling that method, you can use
403+
:method:`Symfony\\Component\\PropertyAccess\\PropertyAccessor::isReadable` instead::
406404

407405
$person = new Person();
408406

409407
if ($propertyAccessor->isReadable($person, 'firstName')) {
410408
// ...
411409
}
412410

413-
The same is possible for :method:`PropertyAccessor::setValue<Symfony\\Component\\PropertyAccess\\PropertyAccessor::setValue>`:
414-
Call the
415-
:method:`PropertyAccessor::isWritable<Symfony\\Component\\PropertyAccess\\PropertyAccessor::isWritable>`
411+
The same is possible for :method:`Symfony\\Component\\PropertyAccess\\PropertyAccessor::setValue`:
412+
Call the :method:`Symfony\\Component\\PropertyAccess\\PropertyAccessor::isWritable`
416413
method to find out whether a property path can be updated::
417414

418415
$person = new Person();

Diff for: components/property_info.rst

+5-5
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)