Skip to content
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

Fix phpstan issue #369

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix phpstan issue #369

wants to merge 1 commit into from

Commits on May 24, 2022

  1. Fix phpstan issue

    Currently when creating a RecursiveItemIterator passing a new ArrayIterator, the Iterator is indexed by int.
    
    ```php
    $treeIterator = new \RecursiveIteratorIterator(
                new RecursiveItemIterator(
                    new \ArrayIterator(array($menu))
                ), \RecursiveIteratorIterator::SELF_FIRST
            );
    ```
    
    So we got the following error:
    
    Parameter KnpLabs#1 $iterator of class Knp\Menu\Iterator\RecursiveItemIterator constructor expects
    Traversable<string, Knp\Menu\ItemInterface>, ArrayIterator<int, Knp\Menu\ItemInterface> given.
    
    I can notice that the typehint in CurrentItemFilterIterator is ok:
    https://github.com/KnpLabs/KnpMenu/blob/master/src/Knp/Menu/Iterator/CurrentItemFilterIterator.php
    raziel057 authored May 24, 2022
    Configuration menu
    Copy the full SHA
    bdcecad View commit details
    Browse the repository at this point in the history