Cotya / magento-composer-installer

Composer installer for Magento modules
212 stars 77 forks source link

Composer 1.10 deprecation notice when optimizing autoloader #190

Closed aadmathijssen closed 2 years ago

aadmathijssen commented 3 years ago

When running composer install --optimize-autoloader or composer dump-autoload --optimize, the following deprecation warning is displayed using a Composer 1.10.x version:

Deprecation Notice: Class MagentoHackathon\Composer\Magento\Util\Filesystem\FileSystem located in ./vendor/magento-hackathon/magento-composer-installer/src/MagentoHackathon/Composer/Magento/Util/FileSystem.php does not comply with psr-0 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///path/to/composer.phar/src/Composer/Autoload/ClassMapGenerator.php:201

This deprecation notice has been added in Composer 1.10.0, see the following line in the release notes:

Warning: Added a warning when class names are being loaded by a PSR-4 or PSR-0 rule only due to classmap optimization, but would not otherwise be autoloadable. Composer 2.0 will stop autoloading these classes so make sure you fix your autoload configs.

aadmathijssen commented 2 years ago

When using Composer 2, the following warning is displayed when running composer install --optimize-autoloader or composer dump-autoload --optimize:

Class MagentoHackathon\Composer\Magento\Util\Filesystem\FileSystem located in ./vendor/magento-hackathon/magento-composer-installer/src/MagentoHackathon/Composer/Magento/Util/FileSystem.php does not comply with psr-0 autoloading standard. Skipping.

This does not seem to have any impact, as the referenced class MagentoHackathon\Composer\Magento\Util\Filesystem\FileSystem (which should be named MagentoHackathon\Composer\Magento\Util\Filesystem) is not used at all.

PR #197 fixes this issue.