Skip to content

add docblock type elements to support newly added IteratorAggregate::getIterator PhpStorm support #19036

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
Jun 17, 2016
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
6 changes: 6 additions & 0 deletions src/Symfony/Component/Console/Helper/HelperSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
*/
class HelperSet implements \IteratorAggregate
{
/**
* @var Helper[]
*/
private $helpers = array();
private $command;

Expand Down Expand Up @@ -109,6 +112,9 @@ public function getCommand()
return $this->command;
}

/**
* @return Helper[]
*/
public function getIterator()
{
return new \ArrayIterator($this->helpers);
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Finder/Finder.php
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ public function in($dirs)
*
* This method implements the IteratorAggregate interface.
*
* @return \Iterator An iterator
* @return \Iterator|SplFileInfo[] An iterator
*
* @throws \LogicException if the in() method has not been called
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public function __construct($label, array $choices = array())

/**
* {@inheritdoc}
*
* @return ChoiceGroupView[]|ChoiceView[]
*/
public function getIterator()
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps the inheritdoc can stay. If I understand correctly how it is supposed to work, {@inheritdoc} only imports the (long) description.

Copy link
Member

Choose a reason for hiding this comment

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

indeed 👍

{
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Form/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ public function offsetUnset($name)
/**
* Returns the iterator for this group.
*
* @return \Traversable
* @return \Traversable|FormInterface[]
*/
public function getIterator()
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/Form/FormBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ public function getForm()

/**
* {@inheritdoc}
*
* @return FormBuilderInterface[]
*/
public function getIterator()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Form/FormView.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public function offsetUnset($name)
/**
* Returns an iterator to iterate over children (implements \IteratorAggregate).
*
* @return \ArrayIterator The iterator
* @return \ArrayIterator|FormView[] The iterator
*/
public function getIterator()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DumperCollection implements \IteratorAggregate
private $parent;

/**
* @var (DumperCollection|DumperRoute)[]
* @var DumperCollection[]|DumperRoute[]
*/
private $children = array();

Expand All @@ -38,7 +38,7 @@ class DumperCollection implements \IteratorAggregate
/**
* Returns the children routes and collections.
*
* @return (DumperCollection|DumperRoute)[] Array of DumperCollection|DumperRoute
* @return DumperCollection[]|DumperRoute[] Array of DumperCollection|DumperRoute
*/
public function all()
{
Expand Down Expand Up @@ -76,7 +76,7 @@ public function setAll(array $children)
/**
* Returns an iterator over the children.
*
* @return \Iterator The iterator
* @return \Iterator|DumperCollection[]|DumperRoute[] The iterator
*/
public function getIterator()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Routing/RouteCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function __clone()
*
* @see all()
*
* @return \ArrayIterator An \ArrayIterator object for iterating over routes
* @return \ArrayIterator|Route[] An \ArrayIterator object for iterating over routes
*/
public function getIterator()
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/Validator/ConstraintViolationList.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ public function remove($offset)

/**
* {@inheritdoc}
*
* @return \ArrayIterator|ConstraintViolationInterface[]
*/
public function getIterator()
{
Expand Down