ComposerRequireChecker icon indicating copy to clipboard operation
ComposerRequireChecker copied to clipboard

ComposerRequireChecker lists unresolved symbols from vendors

Open Adirelle opened this issue 7 years ago • 9 comments

When the vendor directory is contained in the source directory, ComposerRequireChecker lists all unresolved vendors' symbols.

Full evidence here : https://gist.github.com/Adirelle/ce6a8045c93c86b98ff2b86cc504056f

I guess the same happens if the test directory is contained in the source directory.

Adirelle avatar Nov 16 '17 08:11 Adirelle

Must say that this feels like an excessive edge case. Most tooling will simply not working with such a weird setup, and I wouldn't expect them to work.

On 16 Nov 2017 10:11, "Adirelle" [email protected] wrote:

When the vendor directory is contained in the source directory, ComposerRequireChecker lists all unresolved vendors' symbols.

Full evidence here : https://gist.github.com/Adirelle/ ce6a8045c93c86b98ff2b86cc504056f

I guess the same happens if the test directory is contained in the source directory.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/maglnet/ComposerRequireChecker/issues/47, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJakLHR2nMEDTGOMBCNLfpYmSGt0Ptjks5s2-41gaJpZM4QgGo_ .

Ocramius avatar Nov 16 '17 08:11 Ocramius

Surprisingly, it is the first time I really have an issue with this. Most tools have an --exclude option, which is bulky but sufficient. I do not like this kind of directory layout either but I have legacy projects...

Adirelle avatar Nov 16 '17 08:11 Adirelle

Then this is tech debt that needs resolution before pushing the problem to tooling. I have at least another 3 libraries which will just panic with your edge case.

On 16 Nov 2017 10:48, "Adirelle" [email protected] wrote:

Surprisingly, it is the first time I really have an issue with this. Most tools have an --exclude option, which is bulky but sufficient. I do not like this kind of directory layout either but I have legacy projects...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/maglnet/ComposerRequireChecker/issues/47#issuecomment-344854955, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJakGxn54TRS8jEqJQWIyF_t01EbheVks5s2_bygaJpZM4QgGo_ .

Ocramius avatar Nov 16 '17 09:11 Ocramius

would this be solved by #46 ?

maglnet avatar Nov 16 '17 13:11 maglnet

sorry, I got it wrong, probably this can hardly be fixed because the autoload directive says that your sources are within all directories (including vendor) so it also checks the files within vendor... With #46 you can exclude vendor from classmap, but that will fail miserably I think.

maglnet avatar Nov 16 '17 13:11 maglnet

Definetely not an edge case. We have a mono-repo and every library / subproject has it's source folders directly within the root / same level as composer.json. No problem with any other tool as they either ignore 3rd party folders like node_modules / vendor or provide appropriate options.

See also:

buffcode avatar May 25 '20 20:05 buffcode

@buffcode this tool only scans sources mapped in your autoload and/or autoload-dev

Ocramius avatar May 25 '20 21:05 Ocramius

@Adirelle is issue related to #110

antonmarin avatar Jul 13 '21 09:07 antonmarin

@Adirelle is issue related to #110

It is: same cause with different outcomes.

I am also wondering what would happen with a test directory (with proper autoload-dev) under the src directory (autoload)...

Adirelle avatar Jul 15 '21 09:07 Adirelle