nextras / orm

Orm with clean object design, smart relationship loading and powerful collections.
https://nextras.org/orm
MIT License
310 stars 57 forks source link

Composer's --optimize-autoloader or --classmap-authoritate throws deprecation warning towards Composer v2 for compatibility.php #456

Closed stpnkcrk closed 4 years ago

stpnkcrk commented 4 years ago

Describe the bug Installing nextras/orm with --optimize-autoloader or --classmap-authoritate throws deprecation warning about not complying with PSR-4 autoloading standard and message that Exception classes from compatibility.php won't be autoloaded with Composer v2.

Versions

Deprecation Notice: Class Nextras\Orm\InvalidArgumentException located in ./vendor/nextras/orm/src/compatibility.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Nextras\Orm\InvalidModifierDefinitionException located in ./vendor/nextras/orm/src/compatibility.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Nextras\Orm\NullValueException located in ./vendor/nextras/orm/src/compatibility.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Nextras\Orm\RuntimeException located in ./vendor/nextras/orm/src/compatibility.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Nextras\Orm\InvalidStateException located in ./vendor/nextras/orm/src/compatibility.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Nextras\Orm\IOException located in ./vendor/nextras/orm/src/compatibility.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Nextras\Orm\LogicException located in ./vendor/nextras/orm/src/compatibility.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Nextras\Orm\MemberAccessException located in ./vendor/nextras/orm/src/compatibility.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Nextras\Orm\NotImplementedException located in ./vendor/nextras/orm/src/compatibility.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Nextras\Orm\NotSupportedException located in ./vendor/nextras/orm/src/compatibility.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
hrach commented 4 years ago

compatibility.php will stay until next major version. It introduces aliases for moved classes to match PSR-4. Not introducing such aliases could heavily break app since these are exceptions - i.e. using them in catch doesn't start autoloader and code simply doesn't catch and silently do something else.

stpnkcrk commented 4 years ago

I see. Thanks for the explanation/clarification.