Skip to content

Conversation

@Haehnchen
Copy link
Contributor

Q A
Branch 2.7
Bug fix no
New feature no
BC breaks no
Deprecations no
Tests pass yes
License MIT

In additional to #16965 PhpStorm supports IteratorAggregate::getIterator now. see https://blog.jetbrains.com/phpstorm/2016/06/phpstorm-2016-2-eap-162-844/

example

$collection  = new \Symfony\Component\Routing\RouteCollection();
foreach ($collection as $route) {
    $route->getHost();
}

* {@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 👍

@fabpot
Copy link
Member

fabpot commented Jun 16, 2016

@Haehnchen Can you finish this PR?

@Haehnchen Haehnchen force-pushed the patch/phpstorm-iterator branch 3 times, most recently from bcf33f1 to 21e584f Compare June 17, 2016 12:39
@Haehnchen Haehnchen force-pushed the patch/phpstorm-iterator branch from 21e584f to ede3556 Compare June 17, 2016 12:42
@Haehnchen
Copy link
Contributor Author

@fabpot done

@nicolas-grekas
Copy link
Member

Thank you @Haehnchen.

@nicolas-grekas nicolas-grekas merged commit ede3556 into symfony:2.7 Jun 17, 2016
nicolas-grekas added a commit that referenced this pull request Jun 17, 2016
…orAggregate::getIterator PhpStorm support (Haehnchen)

This PR was merged into the 2.7 branch.

Discussion
----------

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

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

In additional to #16965 PhpStorm supports `IteratorAggregate::getIterator` now. see https://blog.jetbrains.com/phpstorm/2016/06/phpstorm-2016-2-eap-162-844/

example
```
$collection  = new \Symfony\Component\Routing\RouteCollection();
foreach ($collection as $route) {
    $route->getHost();
}
```

Commits
-------

ede3556 add docblock type elements to support newly added IteratorAggregate::getIterator PhpStorm support
Haehnchen added a commit to Haehnchen/shopware-platform that referenced this pull request Feb 22, 2019
I was just "playing" with the cart. stacking class together as i noticed collections do not provide ide support. This is just a example for one collection to support autocompletion.

So also how this was implemented in Symfony: symfony/symfony#19036

```
        $cart = new \Shopware\Core\Checkout\Cart\Cart();

        $cart->getLineItems()[0]->getDescription();
        foreach ($cart->getLineItems() as $item) {
            $item->getDescription();
        }
```
shopwareBot pushed a commit to shopware/shopware that referenced this pull request Feb 25, 2019
I was just "playing" with the cart. stacking class together as i noticed collections do not provide ide support. This is just a example for one collection to support autocompletion.

So also how this was implemented in Symfony: symfony/symfony#19036

```
        $cart = new \Shopware\Core\Checkout\Cart\Cart();

        $cart->getLineItems()[0]->getDescription();
        foreach ($cart->getLineItems() as $item) {
            $item->getDescription();
        }
```

fixes #18
shopwareBot pushed a commit to shopware/core that referenced this pull request Feb 25, 2019
I was just "playing" with the cart. stacking class together as i noticed collections do not provide ide support. This is just a example for one collection to support autocompletion.

So also how this was implemented in Symfony: symfony/symfony#19036

```
        $cart = new \Shopware\Core\Checkout\Cart\Cart();

        $cart->getLineItems()[0]->getDescription();
        foreach ($cart->getLineItems() as $item) {
            $item->getDescription();
        }
```

fixes #18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants