Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[PropertyInfo] Added documentation about camelCase assumption for getter/setter methods#18942

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
javiereguiluz merged 1 commit intosymfony:6.4fromjbtronics:pi_i18940
Oct 4, 2023
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletioncomponents/property_info.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -225,7 +225,14 @@ provide whether properties are readable or writable as booleans::
The :class:`Symfony\\Component\\PropertyInfo\\Extractor\\ReflectionExtractor` looks
for getter/isser/setter/hasser method in addition to whether or not a property is public
to determine if it's accessible. This based on how the :doc:`PropertyAccess </components/property_access>`
works.
works. It assumes camel case style method names following `PSR-1`_. Therefore, a property like ``myProperty`` or ``my_property`` is
readable if it has a ``getMyProperty()`` and writable if it has a ``setMyProperty()`` method.

.. versionadded:: 6.4

Camel case style setter methods for properties in snake case (like ``my_property``) are accepted since Symfony 6.4. Before, the
setter name had to contain the underscores (e.g. `setMy_property()`) to make the property assumed writable.


.. _property-info-initializable:

Expand DownExpand Up@@ -552,6 +559,7 @@ service by defining it as a service with one or more of the following
* ``property_info.initializable_extractor`` if it provides initializable information
(it checks if a property can be initialized through the constructor).

.. _`PSR-1`: https://www.php-fig.org/psr/psr-1/
.. _`phpDocumentor Reflection`: https://github.com/phpDocumentor/ReflectionDocBlock
.. _`phpdocumentor/reflection-docblock`: https://packagist.org/packages/phpdocumentor/reflection-docblock
.. _`phpstan/phpdoc-parser`: https://packagist.org/packages/phpstan/phpdoc-parser
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp