Issue
When performing a composer update, I received the following warning:
Warning: Ambiguous class resolution, "Normalizer" was found in both "/var/www/concrete5/vendor/patchwork/utf8/src/Normalizer.php" and "/var/www/concrete5/vendor/voku/portable-utf8/src/Normalizer.php", the first will be used.
The site is now experiencing errors which I think might be related.
How can I instruct composer to use the second file (i.e. /var/www/concrete5/vendor/voku/portable-utf8/src/Normalizer.php) instead of the first?
Note that I have tried adding the following to exclude-from-classmap to composer.json and while it suppresses the warning, doesn't appear to have any impact.
"autoload-dev": {
"psr-4": {
"ConcreteComposer\\" : "./tests"
},
"exclude-from-classmap": [
"vendor/patchwork/utf8/src/Normalizer.php"
]
},
Solution
exclude-from-classmap has effect only when classmap is used for autoloading specified class. In your case class is loaded using PSR rules, but you may use optimized autolader, which generates classmap for all classes:
composer install -o
Also, since you placed this rule inside of autoload-dev, it will not have effect when you run composer install with --no-dev flag.
Answered By - rob006
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.