Is there a way to disable the “Ambiguous class resolution” warning when running composer install
?
I use a package which has classes with the same name (and namespace) in different folders.
I know of this bug, but it's not that because the classes are actually twice in the vendor. I just can't do anything about it.
I'm also aware of the --no-autoloader
flag which of course doesn't throw the warning, but just because it skips the autoloader generation.
Instead of removing files from vendor
directory (which should be avoided) it is better to add files/direactories with ambiguous classes to exclude-from-classmap
section in your composer.json
:
"autoload": {
...
"exclude-from-classmap": [
"vendor/somevendor/somepackage/directory/with/ambiguous/classes/",
"vendor/somevendor/somepackage/src/AmbiguousClass.php"
]
},
Then Composer will ignore these files during classmap generation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With