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

Mention the adder/remover support of PropertyInfo#9195

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

Closed
javiereguiluz wants to merge2 commits intosymfony:3.4fromjaviereguiluz:fix_7182
Closed
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
40 changes: 38 additions & 2 deletionscomponents/property_info.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -237,8 +237,44 @@ provide whether properties are readable or writable as booleans.

The :class:`Symfony\\Component\\PropertyInfo\\Extractor\\ReflectionExtractor` looks
for getter/isser/setter 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.
to determine if it's accessible.

This is based on how :doc:`PropertyAccess </components/property_access>` works,
so it even looks for in adder/remover methods and can transform between singular
and plural property names::

class SomeClass
{
private $analyses;
private $feet;

public function addAnalyse(Dummy $analyse)
{
// ...
}

public function removeAnalyse(Dummy $analyse)
{
// ...
}

public function addFoot(Dummy $foot)
{
// ...
}

public function removeFoot(Dummy $foot)
{
// ...
}
}

// to be writable, both the adder and the remover methods must be defined
$propertyInfo->isWritable(SomeClass::class, 'analyses'); // returns true
$propertyInfo->isWritable(SomeClass::class, 'feet'); // returns true

.. versionadded:: 3.2
The support of adder/remover methods was introduced in Symfony 3.2.

.. tip::

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp