8000 Replace array|\Traversable by iterable by ro0NL · Pull Request #24969 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Replace array|\Traversable by iterable #24969

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
Nov 18, 2017
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/Symfony/Component/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -1015,8 +1015,8 @@ public function extractNamespace($name, $limit = null)
* Finds alternative of $name among $collection,
* if nothing is found in $collection, try in $abbrevs.
*
* @param string $name The string
* @param array|\Traversable $collection The collection
* @param string $name The string
* @param iterable $collection The collection
*
* @return string[] A sorted array of similar string
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Console/Question/Question.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function setHiddenFallback($fallback)
/**
* Gets values for the autocompleter.
*
* @return null|array|\Traversable
* @return null|iterable
*/
public function getAutocompleterValues()
{
Expand All @@ -124,7 +124,7 @@ public function getAutocompleterValues()
/**
* Sets values for the autocompleter.
*
* @param null|array|\Traversable $values
* @param null|iterable $values
*
* @return $this
*
Expand Down
34 changes: 17 additions & 17 deletions src/Symfony/Component/Filesystem/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ public function copy($originFile, $targetFile, $overwriteNewerFiles = false)
/**
* Creates a directory recursively.
*
* @param string|array|\Traversable $dirs The directory path
* @param int $mode The directory mode
* @param string|iterable $dirs The directory path
* @param int $mode The directory mode
*
* @throws IOException On any directory creation failure
*/
Expand All @@ -111,7 +111,7 @@ public function mkdir($dirs, $mode = 0777)
/**
* Checks the existence of files or directories.
*
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to check
* @param string|iterable $files A filename, an array of files, or a \Traversable instance to check
*
* @return bool true if the file exists, false otherwise
*/
Expand All @@ -135,9 +135,9 @@ public function exists($files)
/**
* Sets access and modification time of file.
*
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to create
* @param int $time The touch time as a Unix timestamp
* @param int $atime The access time as a Unix timestamp
* @param string|iterable $files A filename, an array of files, or a \Traversable instance to create
* @param int $time The touch time as a Unix timestamp
* @param int $atime The access time as a Unix timestamp
*
* @throws IOException When touch fails
*/
Expand All @@ -154,7 +154,7 @@ public function touch($files, $time = null, $atime = null)
/**
* Removes files or directories.
*
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to remove
* @param string|iterable $files A filename, an array of files, or a \Traversable instance to remove
*
* @throws IOException When removal fails
*/
Expand Down Expand Up @@ -190,10 +190,10 @@ public function remove($files)
/**
* Change mode for an array of files or directories.
*
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to change mode
* @param int $mode The new mode (octal)
* @param int $umask The mode mask (octal)
* @param bool $recursive Whether change the mod recursively or not
* @param string|iterable $files A filename, an array of files, or a \Traversable instance to change mode
* @param int $mode The new mode (octal)
* @param int $umask The mode mask (octal)
* @param bool $recursive Whether change the mod recursively or not
*
* @throws IOException When the change fail
*/
Expand All @@ -212,9 +212,9 @@ public function chmod($files, $mode, $umask = 0000, $recursive = false)
/**
* Change the owner of an array of files or directories.
*
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to change owner
* @param string $user The new owner user name
* @param bool $recursive Whether change the owner recursively or not
* @param string|iterable $files A filename, an array of files, or a \Traversable instance to change owner
* @param string $user The new owner user name
* @param bool $recursive Whether change the owner recursively or not
*
* @throws IOException When the change fail
*/
Expand All @@ -239,9 +239,9 @@ public function chown($files, $user, $recursive = false)
/**
* Change the group of an array of files or directories.
*
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to change group
* @param string $group The group name
* @param bool $recursive Whether change the group recursively or not
* @param string|iterable $files A filename, an array of files, or a \Traversable instance to change group
* @param string $group The group name
* @param bool $recursive Whether change the group recursively or not
*
* @throws IOException When the change fail
*/
Expand Down
10 changes: 5 additions & 5 deletions src/Symfony/Component/Form/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
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
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
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,11 @@ private function writeArray($file, array $value, $indentation)
/**
* Writes a "table" node.
*
* @param resource $file The file handle to write to
* @param array|\Traversable $value The value of the node
* @param int $indentation The number of levels to indent
* @param bool $fallback Whether the table should be merged
* with the fallback locale
* @param resource $file The file handle to write to
* @param iterable $value The value of the node
* @param int $indentation The number of levels to indent
* @param bool $fallback Whether the table should be merged
* with the fallback locale
*
* @throws UnexpectedTypeException when $value is not an array and not a
* \Traversable instance
Expand Down
10 changes: 5 additions & 5 deletions src/Symfony/Component/PropertyAccess/PropertyAccessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -611,11 +611,11 @@ private function writeProperty($zval, $property, $value)
/**
* Adjusts a collection-valued property by calling add*() and remove*() methods.
*
* @param array $zval The array containing the object to write to
* @param string $property The property to write
* @param array|\Traversable $collection The collection to write
* @param string $addMethod The add*() method
* @param string $removeMethod The remove*() method
* @param array $zval The array containing the object to write to
* @param string $property The property to write
* @param iterable $collection The collection to write
* @param string $addMethod The add*() method
* @param string $removeMethod The remove*() method
*/
private function writeCollection($zval, $property, $collection, $addMethod, $removeMethod)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ private function validateObject($object, $propertyPath, array $groups, $traversa
* objects are iterated as well. Nested arrays are always iterated,
* regardless of the value of $recursive.
*
* @param array|\Traversable $collection The collection
* @param iterable $collection The collection
* @param string $propertyPath The current property path
* @param string[] $groups The validated groups
* @param bool $stopRecursion Whether to disable
Expand Down
0