CodeIgniter4: Composer PSR-4 notices "does not comply with psr-4 autoloading standard"
PHP Version
8.3
CodeIgniter4 Version
latest
CodeIgniter4 Installation Method
Git
Which operating systems have you tested for this bug?
Linux
What happened?
After composer update for appstarter
After composer update for this develop branch
Composer version 2.7.6 2024-05-04 23:03:15
I understand that you need to write all the rules for PSR-4 in composer.json or delete everything. Although there was no such notification before.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (16 by maintainers)
In the current implementation, the priority of the autoloading is:
Composer autoloader has the feature to generate classmap automatically for better performance, https://getcomposer.org/doc/articles/autoloader-optimization.md#autoloader-optimization and it is enabled by default in CI4. https://github.com/codeigniter4/CodeIgniter4/blob/b6c668c9115a603b848039cc07154ad13dff1c05/admin/starter/composer.json#L35
This feature works only with namespaces defined in Composer. So it is better to define namespaces in
composer.jsonas much as possible.