Skip to content

Commit 59576af

Browse files
committed
Tweaks
1 parent 669b470 commit 59576af

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

components/property_info.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,15 @@ provide whether properties are readable or writable as booleans::
225225
The :class:`Symfony\\Component\\PropertyInfo\\Extractor\\ReflectionExtractor` looks
226226
for getter/isser/setter/hasser method in addition to whether or not a property is public
227227
to determine if it's accessible. This based on how the :doc:`PropertyAccess </components/property_access>`
228-
works. It assumes camel case style method names following `PSR-1`_. Therefore, a property like ``myProperty`` or ``my_property`` is
229-
readable if it has a ``getMyProperty()`` and writable if it has a ``setMyProperty()`` method.
228+
works. It assumes camel case style method names following `PSR-1`_. For example,
229+
both ``myProperty`` and ``my_property`` properties are readable if there's a
230+
``getMyProperty()`` method and writable if there's a ``setMyProperty()`` method.
230231

231232
.. versionadded:: 6.4
232233

233-
Camel case style setter methods for properties in snake case (like ``my_property``) are accepted since Symfony 6.4. Before, the
234-
setter name had to contain the underscores (e.g. `setMy_property()`) to make the property assumed writable.
235-
234+
In Symfony versions prior to 6.4, snake case properties (e.g. ``my_property``)
235+
were not writable by camel case methods (e.g. ``setMyProperty()``). You had
236+
to define method names with underscores (e.g. ``setMy_property()``).
236237

237238
.. _property-info-initializable:
238239

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy