Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composer PSR-4 notices "does not comply with psr-4 autoloading standard" #8951

Closed
neznaika0 opened this issue Jun 10, 2024 · 16 comments
Closed

Comments

@neznaika0
Copy link
Contributor

neznaika0 commented Jun 10, 2024

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.

@neznaika0 neznaika0 added the bug Verified issues on the current code behavior or pull requests that will fix them label Jun 10, 2024
@kenjis
Copy link
Member

kenjis commented Jun 10, 2024

Cannot reproduce.

appstarter 4.5.1:

$ composer update
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 3 updates, 0 removals
  - Upgrading codeigniter4/framework (v4.5.1 => v4.5.2)
  - Upgrading phpunit/phpunit (10.5.19 => 10.5.20)
  - Upgrading symfony/deprecation-contracts (v3.4.0 => v3.5.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 30 installs, 1 update, 0 removals
  - Upgrading codeigniter4/framework (v4.5.1 => v4.5.2): Extracting archive
  - Installing symfony/deprecation-contracts (v3.5.0): Extracting archive
  - Installing psr/container (2.0.2): Extracting archive
  - Installing fakerphp/faker (v1.23.1): Extracting archive
  - Installing mikey179/vfsstream (v1.6.11): Extracting archive
  - Installing sebastian/version (4.0.1): Extracting archive
  - Installing sebastian/type (4.0.0): Extracting archive
  - Installing sebastian/recursion-context (5.0.0): Extracting archive
  - Installing sebastian/object-reflector (3.0.0): Extracting archive
  - Installing sebastian/object-enumerator (5.0.0): Extracting archive
  - Installing sebastian/global-state (6.0.2): Extracting archive
  - Installing sebastian/exporter (5.1.2): Extracting archive
  - Installing sebastian/environment (6.1.0): Extracting archive
  - Installing sebastian/diff (5.1.1): Extracting archive
  - Installing sebastian/comparator (5.0.1): Extracting archive
  - Installing sebastian/code-unit (2.0.0): Extracting archive
  - Installing sebastian/cli-parser (2.0.1): Extracting archive
  - Installing phpunit/php-timer (6.0.0): Extracting archive
  - Installing phpunit/php-text-template (3.0.1): Extracting archive
  - Installing phpunit/php-invoker (4.0.0): Extracting archive
  - Installing phpunit/php-file-iterator (4.1.0): Extracting archive
  - Installing theseer/tokenizer (1.2.3): Extracting archive
  - Installing nikic/php-parser (v5.0.2): Extracting archive
  - Installing sebastian/lines-of-code (2.0.2): Extracting archive
  - Installing sebastian/complexity (3.2.0): Extracting archive
  - Installing sebastian/code-unit-reverse-lookup (3.0.0): Extracting archive
  - Installing phpunit/php-code-coverage (10.1.14): Extracting archive
  - Installing phar-io/version (3.2.1): Extracting archive
  - Installing phar-io/manifest (2.0.4): Extracting archive
  - Installing myclabs/deep-copy (1.11.1): Extracting archive
  - Installing phpunit/phpunit (10.5.20): Extracting archive
Generating optimized autoload files
26 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
infection/extension-installer: No extensions found
No security vulnerability advisories found.
$ composer --version
Composer version 2.7.6 2024-05-04 23:03:15

@kenjis kenjis removed the bug Verified issues on the current code behavior or pull requests that will fix them label Jun 10, 2024
@paulbalandan
Copy link
Member

It seems in your composer.json autoload.psr-4 section you have set mapping for App\ and CodeIgniter\

@neznaika0
Copy link
Contributor Author

@paulbalandan
Copy link
Member

Ok, I cannot also reproduce:

$ ~/Workspace/appstarter composer update                                                                                  ✔ 
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 1 update, 0 removals
  - Upgrading codeigniter4/framework (v4.5.1 => v4.5.2)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
  - Upgrading codeigniter4/framework (v4.5.1 => v4.5.2): Extracting archive
Generating optimized autoload files
26 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
No security vulnerability advisories found.

@neznaika0
Copy link
Contributor Author

neznaika0 commented Jun 10, 2024

In Windows all done. PHP 8.2 Composer 2.7.6
Hmm...
I install as app in system. Maybe because of this?
image

@neznaika0
Copy link
Contributor Author

It may be worth waiting, there is already a release 2..7.7

composer/class-map-generator#8

@kenjis
Copy link
Member

kenjis commented Jun 12, 2024

I could reproduce with this repository and Composer version 2.7.7 2024-06-10 22:11:12.
But the all warnings are correct.

$ composer update
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 2 updates, 0 removals
  - Upgrading myclabs/deep-copy (1.11.1 => 1.12.0)
  - Upgrading react/stream (v1.3.0 => v1.4.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 2 updates, 0 removals
  - Downloading react/stream (v1.4.0)
  - Downloading myclabs/deep-copy (1.12.0)
  - Upgrading react/stream (v1.3.0 => v1.4.0): Extracting archive
  - Upgrading myclabs/deep-copy (1.11.1 => 1.12.0): Extracting archive
Generating optimized autoload files
Class Laminas\Escaper\Escaper located in ./system/ThirdParty/Escaper/Escaper.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Laminas\Escaper\Exception\ExceptionInterface located in ./system/ThirdParty/Escaper/Exception/ExceptionInterface.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Laminas\Escaper\Exception\RuntimeException located in ./system/ThirdParty/Escaper/Exception/RuntimeException.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Laminas\Escaper\Exception\InvalidArgumentException located in ./system/ThirdParty/Escaper/Exception/InvalidArgumentException.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Psr\Log\LoggerAwareInterface located in ./system/ThirdParty/PSR/Log/LoggerAwareInterface.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Psr\Log\LogLevel located in ./system/ThirdParty/PSR/Log/LogLevel.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Psr\Log\LoggerAwareTrait located in ./system/ThirdParty/PSR/Log/LoggerAwareTrait.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Psr\Log\InvalidArgumentException located in ./system/ThirdParty/PSR/Log/InvalidArgumentException.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Psr\Log\NullLogger located in ./system/ThirdParty/PSR/Log/NullLogger.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Psr\Log\LoggerInterface located in ./system/ThirdParty/PSR/Log/LoggerInterface.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Psr\Log\LoggerTrait located in ./system/ThirdParty/PSR/Log/LoggerTrait.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Psr\Log\AbstractLogger located in ./system/ThirdParty/PSR/Log/AbstractLogger.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\RendererInterface located in ./system/ThirdParty/Kint/Renderer/RendererInterface.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\TextRenderer located in ./system/ThirdParty/Kint/Renderer/TextRenderer.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\AbstractRenderer located in ./system/ThirdParty/Kint/Renderer/AbstractRenderer.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\RichRenderer located in ./system/ThirdParty/Kint/Renderer/RichRenderer.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\PlainRenderer located in ./system/ThirdParty/Kint/Renderer/PlainRenderer.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Rich\SimpleXMLElementPlugin located in ./system/ThirdParty/Kint/Renderer/Rich/SimpleXMLElementPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Rich\ArrayLimitPlugin located in ./system/ThirdParty/Kint/Renderer/Rich/ArrayLimitPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Rich\BinaryPlugin located in ./system/ThirdParty/Kint/Renderer/Rich/BinaryPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Rich\ColorPlugin located in ./system/ThirdParty/Kint/Renderer/Rich/ColorPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Rich\TabPluginInterface located in ./system/ThirdParty/Kint/Renderer/Rich/TabPluginInterface.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Rich\SourcePlugin located in ./system/ThirdParty/Kint/Renderer/Rich/SourcePlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Rich\BlacklistPlugin located in ./system/ThirdParty/Kint/Renderer/Rich/BlacklistPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Rich\ValuePluginInterface located in ./system/ThirdParty/Kint/Renderer/Rich/ValuePluginInterface.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Rich\RecursionPlugin located in ./system/ThirdParty/Kint/Renderer/Rich/RecursionPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Rich\MicrotimePlugin located in ./system/ThirdParty/Kint/Renderer/Rich/MicrotimePlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Rich\ClosurePlugin located in ./system/ThirdParty/Kint/Renderer/Rich/ClosurePlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Rich\CallablePlugin located in ./system/ThirdParty/Kint/Renderer/Rich/CallablePlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Rich\PluginInterface located in ./system/ThirdParty/Kint/Renderer/Rich/PluginInterface.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Rich\AbstractPlugin located in ./system/ThirdParty/Kint/Renderer/Rich/AbstractPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Rich\TraceFramePlugin located in ./system/ThirdParty/Kint/Renderer/Rich/TraceFramePlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Rich\DepthLimitPlugin located in ./system/ThirdParty/Kint/Renderer/Rich/DepthLimitPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Rich\TablePlugin located in ./system/ThirdParty/Kint/Renderer/Rich/TablePlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Rich\TimestampPlugin located in ./system/ThirdParty/Kint/Renderer/Rich/TimestampPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Rich\MethodDefinitionPlugin located in ./system/ThirdParty/Kint/Renderer/Rich/MethodDefinitionPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Text\ArrayLimitPlugin located in ./system/ThirdParty/Kint/Renderer/Text/ArrayLimitPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Text\BlacklistPlugin located in ./system/ThirdParty/Kint/Renderer/Text/BlacklistPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Text\RecursionPlugin located in ./system/ThirdParty/Kint/Renderer/Text/RecursionPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Text\MicrotimePlugin located in ./system/ThirdParty/Kint/Renderer/Text/MicrotimePlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Text\PluginInterface located in ./system/ThirdParty/Kint/Renderer/Text/PluginInterface.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Text\TracePlugin located in ./system/ThirdParty/Kint/Renderer/Text/TracePlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Text\AbstractPlugin located in ./system/ThirdParty/Kint/Renderer/Text/AbstractPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Text\DepthLimitPlugin located in ./system/ThirdParty/Kint/Renderer/Text/DepthLimitPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\Text\EnumPlugin located in ./system/ThirdParty/Kint/Renderer/Text/EnumPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Renderer\CliRenderer located in ./system/ThirdParty/Kint/Renderer/CliRenderer.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Zval\ParameterHoldingTrait located in ./system/ThirdParty/Kint/Zval/ParameterHoldingTrait.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Zval\TraceFrameValue located in ./system/ThirdParty/Kint/Zval/TraceFrameValue.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Zval\ParameterValue located in ./system/ThirdParty/Kint/Zval/ParameterValue.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Zval\BlobValue located in ./system/ThirdParty/Kint/Zval/BlobValue.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Zval\MethodValue located in ./system/ThirdParty/Kint/Zval/MethodValue.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Zval\StreamValue located in ./system/ThirdParty/Kint/Zval/StreamValue.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Zval\DateTimeValue located in ./system/ThirdParty/Kint/Zval/DateTimeValue.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Zval\SimpleXMLElementValue located in ./system/ThirdParty/Kint/Zval/SimpleXMLElementValue.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Zval\ClosureValue located in ./system/ThirdParty/Kint/Zval/ClosureValue.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Zval\ThrowableValue located in ./system/ThirdParty/Kint/Zval/ThrowableValue.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Zval\Value located in ./system/ThirdParty/Kint/Zval/Value.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Zval\Representation\SplFileInfoRepresentation located in ./system/ThirdParty/Kint/Zval/Representation/SplFileInfoRepresentation.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Zval\Representation\MicrotimeRepresentation located in ./system/ThirdParty/Kint/Zval/Representation/MicrotimeRepresentation.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Zval\Representation\Representation located in ./system/ThirdParty/Kint/Zval/Representation/Representation.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Zval\Representation\SourceRepresentation located in ./system/ThirdParty/Kint/Zval/Representation/SourceRepresentation.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Zval\Representation\MethodDefinitionRepresentation located in ./system/ThirdParty/Kint/Zval/Representation/MethodDefinitionRepresentation.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Zval\Representation\ColorRepresentation located in ./system/ThirdParty/Kint/Zval/Representation/ColorRepresentation.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Zval\InstanceValue located in ./system/ThirdParty/Kint/Zval/InstanceValue.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Zval\TraceValue located in ./system/ThirdParty/Kint/Zval/TraceValue.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Zval\EnumValue located in ./system/ThirdParty/Kint/Zval/EnumValue.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Zval\ResourceValue located in ./system/ThirdParty/Kint/Zval/ResourceValue.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Kint located in ./system/ThirdParty/Kint/Kint.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\FacadeInterface located in ./system/ThirdParty/Kint/FacadeInterface.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\SimpleXMLElementPlugin located in ./system/ThirdParty/Kint/Parser/SimpleXMLElementPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\ArrayLimitPlugin located in ./system/ThirdParty/Kint/Parser/ArrayLimitPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\BinaryPlugin located in ./system/ThirdParty/Kint/Parser/BinaryPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\ClassStaticsPlugin located in ./system/ThirdParty/Kint/Parser/ClassStaticsPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\StreamPlugin located in ./system/ThirdParty/Kint/Parser/StreamPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\Parser located in ./system/ThirdParty/Kint/Parser/Parser.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\ColorPlugin located in ./system/ThirdParty/Kint/Parser/ColorPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\IteratorPlugin located in ./system/ThirdParty/Kint/Parser/IteratorPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\ConstructablePluginInterface located in ./system/ThirdParty/Kint/Parser/ConstructablePluginInterface.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\DOMDocumentPlugin located in ./system/ThirdParty/Kint/Parser/DOMDocumentPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\XmlPlugin located in ./system/ThirdParty/Kint/Parser/XmlPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\SplObjectStoragePlugin located in ./system/ThirdParty/Kint/Parser/SplObjectStoragePlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\BlacklistPlugin located in ./system/ThirdParty/Kint/Parser/BlacklistPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\ThrowablePlugin located in ./system/ThirdParty/Kint/Parser/ThrowablePlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\ArrayObjectPlugin located in ./system/ThirdParty/Kint/Parser/ArrayObjectPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\MicrotimePlugin located in ./system/ThirdParty/Kint/Parser/MicrotimePlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\FsPathPlugin located in ./system/ThirdParty/Kint/Parser/FsPathPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\ClosurePlugin located in ./system/ThirdParty/Kint/Parser/ClosurePlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\PluginInterface located in ./system/ThirdParty/Kint/Parser/PluginInterface.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\TracePlugin located in ./system/ThirdParty/Kint/Parser/TracePlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\MysqliPlugin located in ./system/ThirdParty/Kint/Parser/MysqliPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\ToStringPlugin located in ./system/ThirdParty/Kint/Parser/ToStringPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\AbstractPlugin located in ./system/ThirdParty/Kint/Parser/AbstractPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\DateTimePlugin located in ./system/ThirdParty/Kint/Parser/DateTimePlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\SplFileInfoPlugin located in ./system/ThirdParty/Kint/Parser/SplFileInfoPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\ProxyPlugin located in ./system/ThirdParty/Kint/Parser/ProxyPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\TablePlugin located in ./system/ThirdParty/Kint/Parser/TablePlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\JsonPlugin located in ./system/ThirdParty/Kint/Parser/JsonPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\EnumPlugin located in ./system/ThirdParty/Kint/Parser/EnumPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\Base64Plugin located in ./system/ThirdParty/Kint/Parser/Base64Plugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\ClassMethodsPlugin located in ./system/ThirdParty/Kint/Parser/ClassMethodsPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\SerializePlugin located in ./system/ThirdParty/Kint/Parser/SerializePlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Parser\TimestampPlugin located in ./system/ThirdParty/Kint/Parser/TimestampPlugin.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\Utils located in ./system/ThirdParty/Kint/Utils.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Kint\CallFinder located in ./system/ThirdParty/Kint/CallFinder.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./system). Skipping.
Class Encryption located in ./tests/system/Config/fixtures/Encryption.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./tests/system). Skipping.
Class SimpleConfig located in ./tests/system/Config/fixtures/SimpleConfig.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./tests/system). Skipping.
Class RegistrarConfig located in ./tests/system/Config/fixtures/RegistrarConfig.php does not comply with psr-4 autoloading standard (rule: CodeIgniter\ => ./tests/system). Skipping.
65 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
phpstan/extension-installer: Extensions installed
infection/extension-installer: No extensions found
> CodeIgniter\ComposerScripts::postUpdate
> composer update --working-dir=tools/phpmetrics
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
infection/extension-installer: No extensions found
No security vulnerability advisories found.
No security vulnerability advisories found.

@kenjis
Copy link
Member

kenjis commented Jun 12, 2024

$ ci4-install.php ci4app
[ci4-install] composer create-project codeigniter4/appstarter ci4app
Creating a "codeigniter4/appstarter" project at "./ci4app"
Installing codeigniter4/appstarter (v4.5.2)
  - Installing codeigniter4/appstarter (v4.5.2): Extracting archive
Created project in /Users/kenji/tmp/ci4app
Loading composer repositories with package information
Updating dependencies
Lock file operations: 33 installs, 0 updates, 0 removals
  - Locking codeigniter4/framework (v4.5.2)
  - Locking fakerphp/faker (v1.23.1)
  - Locking laminas/laminas-escaper (2.13.0)
  - Locking mikey179/vfsstream (v1.6.11)
  - Locking myclabs/deep-copy (1.12.0)
  - Locking nikic/php-parser (v5.0.2)
  - Locking phar-io/manifest (2.0.4)
  - Locking phar-io/version (3.2.1)
  - Locking phpunit/php-code-coverage (10.1.14)
  - Locking phpunit/php-file-iterator (4.1.0)
  - Locking phpunit/php-invoker (4.0.0)
  - Locking phpunit/php-text-template (3.0.1)
  - Locking phpunit/php-timer (6.0.0)
  - Locking phpunit/phpunit (10.5.20)
  - Locking psr/container (2.0.2)
  - Locking psr/log (3.0.0)
  - Locking sebastian/cli-parser (2.0.1)
  - Locking sebastian/code-unit (2.0.0)
  - Locking sebastian/code-unit-reverse-lookup (3.0.0)
  - Locking sebastian/comparator (5.0.1)
  - Locking sebastian/complexity (3.2.0)
  - Locking sebastian/diff (5.1.1)
  - Locking sebastian/environment (6.1.0)
  - Locking sebastian/exporter (5.1.2)
  - Locking sebastian/global-state (6.0.2)
  - Locking sebastian/lines-of-code (2.0.2)
  - Locking sebastian/object-enumerator (5.0.0)
  - Locking sebastian/object-reflector (3.0.0)
  - Locking sebastian/recursion-context (5.0.0)
  - Locking sebastian/type (4.0.0)
  - Locking sebastian/version (4.0.1)
  - Locking symfony/deprecation-contracts (v3.5.0)
  - Locking theseer/tokenizer (1.2.3)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 33 installs, 0 updates, 0 removals
  - Installing psr/log (3.0.0): Extracting archive
  - Installing laminas/laminas-escaper (2.13.0): Extracting archive
  - Installing codeigniter4/framework (v4.5.2): Extracting archive
  - Installing symfony/deprecation-contracts (v3.5.0): Extracting archive
  - Installing psr/container (2.0.2): Extracting archive
  - Installing fakerphp/faker (v1.23.1): Extracting archive
  - Installing mikey179/vfsstream (v1.6.11): Extracting archive
  - Installing sebastian/version (4.0.1): Extracting archive
  - Installing sebastian/type (4.0.0): Extracting archive
  - Installing sebastian/recursion-context (5.0.0): Extracting archive
  - Installing sebastian/object-reflector (3.0.0): Extracting archive
  - Installing sebastian/object-enumerator (5.0.0): Extracting archive
  - Installing sebastian/global-state (6.0.2): Extracting archive
  - Installing sebastian/exporter (5.1.2): Extracting archive
  - Installing sebastian/environment (6.1.0): Extracting archive
  - Installing sebastian/diff (5.1.1): Extracting archive
  - Installing sebastian/comparator (5.0.1): Extracting archive
  - Installing sebastian/code-unit (2.0.0): Extracting archive
  - Installing sebastian/cli-parser (2.0.1): Extracting archive
  - Installing phpunit/php-timer (6.0.0): Extracting archive
  - Installing phpunit/php-text-template (3.0.1): Extracting archive
  - Installing phpunit/php-invoker (4.0.0): Extracting archive
  - Installing phpunit/php-file-iterator (4.1.0): Extracting archive
  - Installing theseer/tokenizer (1.2.3): Extracting archive
  - Installing nikic/php-parser (v5.0.2): Extracting archive
  - Installing sebastian/lines-of-code (2.0.2): Extracting archive
  - Installing sebastian/complexity (3.2.0): Extracting archive
  - Installing sebastian/code-unit-reverse-lookup (3.0.0): Extracting archive
  - Installing phpunit/php-code-coverage (10.1.14): Extracting archive
  - Installing phar-io/version (3.2.1): Extracting archive
  - Installing phar-io/manifest (2.0.4): Extracting archive
  - Installing myclabs/deep-copy (1.12.0): Extracting archive
  - Installing phpunit/phpunit (10.5.20): Extracting archive
8 package suggestions were added by new dependencies, use `composer suggest` to see details.
Generating optimized autoload files
Class Config\Email located in ./app/Config/Email.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Autoload located in ./app/Config/Autoload.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\ContentSecurityPolicy located in ./app/Config/ContentSecurityPolicy.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Paths located in ./app/Config/Paths.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Generators located in ./app/Config/Generators.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Logger located in ./app/Config/Logger.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Filters located in ./app/Config/Filters.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Encryption located in ./app/Config/Encryption.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\App located in ./app/Config/App.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\UserAgents located in ./app/Config/UserAgents.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Feature located in ./app/Config/Feature.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Kint located in ./app/Config/Kint.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Migrations located in ./app/Config/Migrations.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Services located in ./app/Config/Services.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Database located in ./app/Config/Database.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Cache located in ./app/Config/Cache.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Session located in ./app/Config/Session.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Cookie located in ./app/Config/Cookie.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Toolbar located in ./app/Config/Toolbar.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Mimes located in ./app/Config/Mimes.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\DocTypes located in ./app/Config/DocTypes.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Routing located in ./app/Config/Routing.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Publisher located in ./app/Config/Publisher.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\CURLRequest located in ./app/Config/CURLRequest.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\View located in ./app/Config/View.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Modules located in ./app/Config/Modules.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Validation located in ./app/Config/Validation.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\ForeignCharacters located in ./app/Config/ForeignCharacters.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Optimize located in ./app/Config/Optimize.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Exceptions located in ./app/Config/Exceptions.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Security located in ./app/Config/Security.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Honeypot located in ./app/Config/Honeypot.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Cors located in ./app/Config/Cors.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Format located in ./app/Config/Format.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Images located in ./app/Config/Images.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
Class Config\Pager located in ./app/Config/Pager.php does not comply with psr-4 autoloading standard (rule: App\ => ./app). Skipping.
26 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
infection/extension-installer: No extensions found
No security vulnerability advisories found.

@kenjis
Copy link
Member

kenjis commented Jun 12, 2024

I sent a PR #8962 for this repository, but how can we solve the issue on appstarter?

@neznaika0
Copy link
Contributor Author

You need to add a namespace:

        "psr-4": {
            "App\\": "app/",
            "Config\\": "app/Config"
        },

or clear the property:

    "autoload": {
        "exclude-from-classmap": [
            "**/Database/Migrations/**"
        ]
    },

In any case, the code works based on the built-in autoloader.

@kenjis
Copy link
Member

kenjis commented Jun 13, 2024

The current autoload in composer.json comes from #8005 and #8569

@kenjis
Copy link
Member

kenjis commented Jun 13, 2024

I sent #8963 for appstarter.

@neznaika0
Copy link
Contributor Author

I did not understand the reason for removing Config for performance from #8005. I do not know all the internal details.

Why is this important for composer?
Is it worth abandoning psr in composer?
Is json preferable to an autoloader? So that the autoloader always works.

I know that the editor understands the PSR from composer and gives hints. And vscode remembers any namespaces when declaring.

@kenjis
Copy link
Member

kenjis commented Jun 14, 2024

@neznaika0 I'm not sure that I get what you say correctly.

If you don't get the change in #8569, it is because,
if vendor/codeigniter4/codeigniter4/composer.json has "Config\\": "app/Config/",
vendor/codeigniter4/codeigniter4/app/Config/* will be loaded.
But these files should not be loaded at all.

.
├── app/
│   ├── Config/
├── composer.json
├── vendor/
│   ├── codeigniter4/
│   │   └── codeigniter4/
│   │       ├── app/
│   │       │   ├── Config/ # Files in here should NOT be loaded.
│   │       ├── composer.json
│   │       ├── system/

@kenjis
Copy link
Member

kenjis commented Jun 14, 2024

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.

"optimize-autoloader": true,

This feature works only with namespaces defined in Composer. So it is better to define namespaces in composer.json as much as possible.

@kenjis kenjis changed the title Bug: Composer PSR-4 notices Composer PSR-4 notices Jun 14, 2024
@kenjis
Copy link
Member

kenjis commented Jun 20, 2024

Closed by #8962 and #8963

@kenjis kenjis closed this as completed Jun 20, 2024
@kenjis kenjis changed the title Composer PSR-4 notices Composer PSR-4 notices "does not comply with psr-4 autoloading standard" Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@kenjis @neznaika0 @paulbalandan and others