Skip to content

[PropertyInfo] Mentioned the phpDoc collection type #11866

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 12, 2019
Merged
Changes from all 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
12 changes: 10 additions & 2 deletions components/property_info.rst
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,16 @@ a collection - a non-scalar value capable of containing other values. Currently
this returns ``true`` if:

* The :ref:`built-in PHP data type <components-property-info-type-builtin>`
is ``array``, or
is ``array``;
* The mutator method the property is derived from has a prefix of ``add``
or ``remove`` (which are defined as the list of array mutator prefixes).
or ``remove`` (which are defined as the list of array mutator prefixes);
* The `phpDocumentor`_ annotation is of type "collection" (e.g.
``@var SomeClass<DateTime>``, ``@var SomeClass<integer,string>``,
``@var Doctrine\Common\Collections\Collection<App\Entity\SomeEntity>``, etc.)

.. versionadded:: 4.2

The support of phpDocumentor collection types was introduced in Symfony 4.2.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a link to the phpDocumentor library?


Type::getCollectionKeyType() & Type::getCollectionValueType()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -491,3 +498,4 @@ service by defining it as a service with one or more of the following
.. _`symfony/serializer`: https://packagist.org/packages/symfony/serializer
.. _`symfony/doctrine-bridge`: https://packagist.org/packages/symfony/doctrine-bridge
.. _`doctrine/orm`: https://packagist.org/packages/doctrine/orm
.. _`phpDocumentor`: https://www.phpdoc.org/