Skip to content

Class templates not being populated from Generator #144

@calebdw

Description

@calebdw

PHPantom version

c733048

Installation method

Built from source

Operating system

Linux x86_64

Editor

Neovim

Bug description

Hello!

See example below---it should detect $filePath as non-empty-string and $paths as LazyCollection<int, string>

/**
 * @param string|list<string> $path
 * @return LazyCollection<int, string>
 */
function discover(string|array $path): LazyCollection
{
    $paths = LazyCollection::make(function () use ($path) {
        $files = Finder::create()->files()->name('*.php')->path($path);

        foreach ($files as $filePath => $file) {
            \PHPStan\dumpType($filePath);
            yield (string) $file->getRealPath();
        }
    });

    \PHPStan\dumpType($paths);

    return $paths;
}

Steps to reproduce

see above

Error output or panic trace


.phpantom.toml

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions