[go: up one dir, main page]

Foreach variable autocompletion seems broken when import is involved

Foreach autocompletion seems to be broken if an import is involved:

<?php

namespace Serenata\Blah;

use PhpSpec\Wrapper\Subject\Expectation;

class Foo
{
    public function bar()
    {
        /** @var Expectation[] $item */
        $item = [];

        foreach ($item as $it) {
            $it-> // No autocompletion
        }
    }
}

It works fine if you use the FQCN in the @var type override, though, so it seems like the type is not properly resolved based on import statements here.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information