php-stubs / generator

Generate stubs from any PHP code for IDE completion and static analysis.
https://packagist.org/packages/php-stubs/generator
MIT License
52 stars 11 forks source link

Finder ->append failing silently #11

Closed kkmuffme closed 2 years ago

kkmuffme commented 2 years ago

an issue you encountered yourself already here https://github.com/php-stubs/woocommerce-stubs/blob/master/finder.php

Symfony ->append( '/path/to/file.php' ) should work fine but when doing this the generator fails silently.

Instead one has to workaround with:

->append(
        \StubsGenerator\Finder::create()
            ->in(['source/woocommerce'])
            ->files()
            ->depth('< 1')
            ->path('woocommerce.php')
    )

which is a pain if you have an array of files you want to append

szepeviktor commented 2 years ago

Hello @kkmuffme! This repo is for solving a fixed set of problems upstream.

Please see https://github.com/symfony/finder/blob/5.4/Finder.php#L170 and implement it yourself.