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 Снимок экрана от 2024-06-10 12-45-13

After composer update for this develop branch image

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)

Most upvoted comments

In the current implementation, the priority of the autoloading is:

  1. Composer autoloader
  2. CI4 autoloader
    1. Classmap loader
    2. PSR-4 autoloader

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.json as much as possible.