Skip to content

Commit

Permalink
minor #24969 Replace array|\Traversable by iterable (ro0NL)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.7 branch.

Discussion
----------

Replace array|\Traversable by iterable

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->

Replace `array|\Traversable` by `iterable`, favoring pure API (or less mixed at least :)) and be clear whenever phpdoc is replaced.

https://secure.php.net/manual/en/language.types.iterable.php

Commits
-------

278088931b Replace array|\Traversable by iterable
  • Loading branch information
fabpot committed Nov 18, 2017
2 parents ece23c6 + 0eb49df commit 6321e01
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions ChoiceList/ArrayChoiceList.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ class ArrayChoiceList implements ChoiceListInterface
*
* The given choice array must have the same array keys as the value array.
*
* @param array|\Traversable $choices The selectable choices
* @param callable|null $value The callable for creating the value
* for a choice. If `null` is passed,
* incrementing integers are used as
* values
* @param iterable $choices The selectable choices
* @param callable|null $value The callable for creating the value
* for a choice. If `null` is passed,
* incrementing integers are used as
* values
*/
public function __construct($choices, $value = null)
{
Expand Down
6 changes: 3 additions & 3 deletions ChoiceList/Factory/ChoiceListFactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ interface ChoiceListFactoryInterface
* The callable receives the choice as first and the array key as the second
* argument.
*
* @param array|\Traversable $choices The choices
* @param null|callable $value The callable generating the choice
* values
* @param iterable $choices The choices
* @param null|callable $value The callable generating the choice
* values
*
* @return ChoiceListInterface The choice list
*/
Expand Down
2 changes: 1 addition & 1 deletion ChoiceList/Factory/PropertyAccessDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function getDecoratedFactory()
/**
* {@inheritdoc}
*
* @param array|\Traversable $choices The choices
* @param iterable $choices The choices
* @param null|callable|string|PropertyPath $value The callable or path for
* generating the choice values
*
Expand Down

0 comments on commit 6321e01

Please sign in to comment.