minor #22303 Add \Traversable typehint to phpdoc (MetalArend)

This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #22303).

Discussion
----------

Add \Traversable typehint to phpdoc

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

Most of the times you use a DataMapperInterface, the first thing you do on the `$forms` parameter is `iterator_to_array`. However, as that variable is only hinted as `FormInterface[]`, and most IDE's and static analysers don't rely on code, but on the phpdoc...

Commits
-------

5310f11418 Add \Traversable typehint to phpdoc
This commit is contained in:
Fabien Potencier 2017-04-07 10:05:02 -07:00
commit b784449514
1 changed files with 4 additions and 4 deletions

View File

@ -19,8 +19,8 @@ interface DataMapperInterface
/**
* Maps properties of some data to a list of forms.
*
* @param mixed $data Structured data
* @param FormInterface[] $forms A list of {@link FormInterface} instances
* @param mixed $data Structured data
* @param FormInterface[]|\Traversable $forms A list of {@link FormInterface} instances
*
* @throws Exception\UnexpectedTypeException if the type of the data parameter is not supported.
*/
@ -29,8 +29,8 @@ interface DataMapperInterface
/**
* Maps the data of a list of forms into the properties of some data.
*
* @param FormInterface[] $forms A list of {@link FormInterface} instances
* @param mixed $data Structured data
* @param FormInterface[]|\Traversable $forms A list of {@link FormInterface} instances
* @param mixed $data Structured data
*
* @throws Exception\UnexpectedTypeException if the type of the data parameter is not supported.
*/