8000 minor #24969 Replace array|\Traversable by iterable (ro0NL) · symfony/symfony@86986b4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 86986b4

Browse files
committed
minor #24969 Replace array|\Traversable by iterable (ro0NL)
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 ------- 2780889 Replace array|\Traversable by iterable
2 parents 9447016 + 2780889 commit 86986b4

File tree

9 files changed

+41
-41
lines changed

9 files changed

+41
-41
lines changed

src/Symfony/Component/Console/Application.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,8 +1014,8 @@ public function extractNamespace($name, $limit = null)
10141014
* Finds alternative of $name among $collection,
10151015
* if nothing is found in $collection, try in $abbrevs.
10161016
*
1017-
* @param string $name The string
1018-
* @param array|\Traversable $collection The collection
1017+
* @param string $name The string
1018+
* @param iterable $collection The collection
10191019
*
10201020
* @return string[] A sorted array of similar string
10211021
*/

src/Symfony/Component/Console/Question/Question.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public function setHiddenFallback($fallback)
114114
/**
115115
* Gets values for the autocompleter.
116116
*
117-
* @return null|array|\Traversable
117+
* @return null|iterable
118118
*/
119119
public function getAutocompleterValues()
120120
{
@@ -124,7 +124,7 @@ public function getAutocompleterValues()
124124
/**
125125
* Sets values for the autocompleter.
126126
*
127-
* @param null|array|\Traversable $values
127+
* @param null|iterable $values
128128
*
129129
* @return $this
130130
*

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ public function copy($originFile, $targetFile, $overwriteNewerFiles = false)
8383
/**
8484
* Creates a directory recursively.
8585
*
86-
* @param string|array|\Traversable $dirs The directory path
87-
* @param int $mode The directory mode
86+
* @param string|iterable $dirs The directory path
87+
* @param int $mode The directory mode
8888
*
8989
* @throws IOException On any directory creation failure
9090
*/
@@ -111,7 +111,7 @@ public function mkdir($dirs, $mode = 0777)
111111
/**
112112
* Checks the existence of files or directories.
113113
*
114-
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to check
114+
* @param string|iterable $files A filename, an array of files, or a \Traversable instance to check
115115
*
116116
* @return bool true if the file exists, false otherwise
117117
*/
@@ -135,9 +135,9 @@ public function exists($files)
135135
/**
136136
* Sets access and modification time of file.
137137
*
138-
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to create
139-
* @param int $time The touch time as a Unix timestamp
140-
* @param int $atime The access time as a Unix timestamp
138+
* @param string|iterable $files A filename, an array of files, or a \Traversable instance to create
139+
* @param int $time The touch time as a Unix timestamp
140+
* @param int $atime The access time as a Unix timestamp
141141
*
142142
* @throws IOException When touch fails
143143
*/
@@ -154,7 +154,7 @@ public function touch($files, $time = null, $atime = null)
154154
/**
155155
* Removes files or directories.
156156
*
157-
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to remove
157+
* @param string|iterable $files A filename, an array of files, or a \Traversable instance to remove
158158
*
159159
* @throws IOException When removal fails
160160
*/
@@ -190,10 +190,10 @@ public function remove($files)
190190
/**
191191
* Change mode for an array of files or directories.
192192
*
193-
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to change mode
194-
* @param int $mode The new mode (octal)
195-
* @param int $umask The mode mask (octal)
196-
* @param bool $recursive Whether change the mod recursively or not
193+
* @param string|iterable $files A filename, an array of files, or a \Traversable instance to change mode
194+
* @param int $mode The new mode (octal)
195+
* @param int $umask The mode mask (octal)
196+
* @param bool $recursive Whether change the mod recursively or not
197197
*
198198
* @throws IOException When the change fail
199199
*/
@@ -212,9 +212,9 @@ public function chmod($files, $mode, $umask = 0000, $recursive = false)
212212
/**
213213
* Change the owner of an array of files or directories.
214214
*
215-
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to change owner
216-
* @param string $user The new owner user name
217-
* @param bool $recursive Whether change the owner recursively or not
215+
* @param string|iterable $files A filename, an array of files, or a \Traversable instance to change owner
216+
* @param string $user The new owner user name
217+
* @param bool $recursive Whether change the owner recursively or not
218218
*
219219
* @throws IOException When the change fail
220220
*/
@@ -239,9 +239,9 @@ public function chown($files, $user, $recursive = false)
239239
/**
240240
* Change the group of an array of files or directories.
241241
*
242-
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to change group
243-
* @param string $group The group name
244-
* @param bool $recursive Whether change the group recursively or not
242+
* @param string|iterable $files A filename, an array of files, or a \Traversable instance to change group
243+
* @param string $group The group name
244+
* @param bool $recursive Whether change the group recursively or not
245245
*
246246
* @throws IOException When the change fail
247247
*/

src/Symfony/Component/Form/ChoiceList/ArrayChoiceList.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ class ArrayChoiceList implements ChoiceListInterface
5858
*
5959
* The given choice array must have the same array keys as the value array.
6060
*
61-
* @param array|\Traversable $choices The selectable choices
62-
* @param callable|null $value The callable for creating the value
63-
* for a choice. If `null` is passed,
64-
* incrementing integers are used as
65-
* values
61+
* @param iterable $choices The selectable choices
62+
* @param callable|null $value The callable for creating the value
63+
* for a choice. If `null` is passed,
64+
* incrementing integers are used as
65+
* values
6666
*/
6767
public function __construct($choices, $value = null)
6868
{

src/Symfony/Component/Form/ChoiceList/Factory/ChoiceListFactoryInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ interface ChoiceListFactoryInterface
3131
* The callable receives the choice as first and the array key as the second
3232
* argument.
3333
*
34-
* @param array|\Traversable $choices The choices
35-
* @param null|callable $value The callable generating the choice
36-
* values
34+
* @param iterable $choices The choices
35+
* @param null|callable $value The callable generating the choice
36+
* values
3737
*
3838
* @return ChoiceListInterface The choice list
3939
*/

src/Symfony/Component/Form/ChoiceList/Factory/PropertyAccessDecorator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function getDecoratedFactory()
6363
/**
6464
* {@inheritdoc}
6565
*
66-
* @param array|\Traversable $choices The choices
66+
* @param iterable $choices The choices
6767
* @param null|callable|string|PropertyPath $value The callable or path for
6868
* generating the choice values
6969
*

src/Symfony/Component/Intl/Data/Bundle/Writer/TextBundleWriter.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,11 @@ private function writeArray($file, array $value, $indentation)
195195
/**
196196
* Writes a "table" node.
197197
*
198-
* @param resource $file The file handle to write to
199-
* @param array|\Traversable $value The value of the node
200-
* @param int $indentation The number of levels to indent
201-
* @param bool $fallback Whether the table should be merged
202-
* with the fallback locale
198+
* @param resource $file The file handle to write to
199+
* @param iterable $value The value of the node
200+
* @param int $indentation The number of levels to indent
201+
* @param bool $fallback Whether the table should be merged
202+
* with the fallback locale
203203
*
204204
* @throws UnexpectedTypeException when $value is not an array and not a
205205
* \Traversable instance

src/Symfony/Component/PropertyAccess/PropertyAccessor.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -611,11 +611,11 @@ private function writeProperty($zval, $property, $value)
611611
/**
612612
* Adjusts a collection-valued property by calling add*() and remove*() methods.
613613
*
614-
* @param array $zval The array containing the object to write to
615-
* @param string $property The property to write
616-
* @param array|\Traversable $collection The collection to write
617-
* @param string $addMethod The add*() method
618-
* @param string $removeMethod The remove*() method
614+
* @param array $zval The array containing the object to write to
615+
* @param string $property The property to write
616+
* @param iterable $collection The collection to write
617+
* @param string $addMethod The add*() method
618+
* @param string $removeMethod The remove*() method
619619
*/
620620
private function writeCollection($zval, $property, $collection, $addMethod, $removeMethod)
621621
{

src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ private function validateObject($object, $propertyPath, array $groups, $traversa
378378
* objects are iterated as well. Nested arrays are always iterated,
379379
* regardless of the value of $recursive.
380380
*
381-
* @param array|\Traversable $collection The collection
381+
* @param iterable $collection The collection
382382
* @param string $propertyPath The current property path
383383
* @param string[] $groups The validated groups
384384
* @param bool $stopRecursion Whether to disable

0 commit comments

Comments
 (0)
0