composer autoload deprecation warnings on install #1561

Closed
opened 2026-02-05 01:16:11 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @dgw on GitHub (Feb 28, 2020).

Describe the bug
composer install complains about non-compliant classes ("Deprecation Notice: Class insert\path\here does not comply with psr-4 autoloading standard").

Steps To Reproduce
Steps to reproduce the behavior:

  1. Clone v0.28.2
  2. Run composer install

Expected behavior
I expect not to see a flood of deprecation warnings during installation.

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): v0.28.2
  • PHP Version: 7.2.27
  • Composer Version: 1.9.3
  • Hosting Method (Nginx/Apache/Docker): n/a (issue occurs outside webapp)

Additional context
Full list of deprecation warnings:

Class Tests\ConfigTest located in ./tests/Unit/ConfigTest.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:185
Class Tests\UrlTest located in ./tests/Unit/UrlTest.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:185
Class Tests\SocialAuthTest located in ./tests/Auth/SocialAuthTest.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:185
Class Tests\LdapTest located in ./tests/Auth/LdapTest.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:185
Class Tests\UserInviteTest located in ./tests/Auth/UserInviteTest.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:185
Class Tests\Saml2Test located in ./tests/Auth/Saml2Test.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:185
Class Tests\AuthTest located in ./tests/Auth/AuthTest.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:185
Class Tests\AttachmentTest located in ./tests/Uploads/AttachmentTest.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:185
Class Tests\RestrictionsTest located in ./tests/Permissions/RestrictionsTest.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:185
Class Tests\RolesTest located in ./tests/Permissions/RolesTest.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:185
Class Tests\UserProfileTest located in ./tests/User/UserProfileTest.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:185
Class Tests\UserPreferencesTest located in ./tests/User/UserPreferencesTest.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:185
Class Tests\ApiDocsTest located in ./tests/Api/ApiDocsTest.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:185
Class Tests\BooksApiTest located in ./tests/Api/BooksApiTest.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:185
Class Tests\ApiAuthTest located in ./tests/Api/ApiAuthTest.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:185
Class Tests\ApiConfigTest located in ./tests/Api/ApiConfigTest.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:185
Class Tests\ApiListingTest located in ./tests/Api/ApiListingTest.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:185
Class Tests\ExportTest located in ./tests/Entity/ExportTest.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:185
Class Tests\CommentSettingTest located in ./tests/Entity/CommentSettingTest.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:185
Class Tests\SortTest located in ./tests/Entity/SortTest.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:185
Class Tests\CommentTest located in ./tests/Entity/CommentTest.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:185
Class Tests\EntitySearchTest located in ./tests/Entity/EntitySearchTest.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:185
Class Tests\MarkdownTest located in ./tests/Entity/MarkdownTest.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:185
Class Tests\PageDraftTest located in ./tests/Entity/PageDraftTest.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:185
Class Tests\PageContentTest located in ./tests/Entity/PageContentTest.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:185
Class Tests\TagTest located in ./tests/Entity/TagTest.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:185
Class Tests\EntityTest located in ./tests/Entity/EntityTest.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:185
Class Tests\BookShelfTest located in ./tests/Entity/BookShelfTest.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:185

It appears the only classes affected are in the Tests namespace, so this probably won't affect actually running BookStack in production.

Originally created by @dgw on GitHub (Feb 28, 2020). **Describe the bug** `composer install` complains about non-compliant classes ("Deprecation Notice: Class insert\path\here does not comply with psr-4 autoloading standard"). **Steps To Reproduce** Steps to reproduce the behavior: 1. Clone v0.28.2 2. Run `composer install` **Expected behavior** I expect not to see a flood of deprecation warnings during installation. **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): v0.28.2 - PHP Version: 7.2.27 - Composer Version: 1.9.3 - Hosting Method (Nginx/Apache/Docker): n/a (issue occurs outside webapp) **Additional context** Full list of deprecation warnings: ``` Class Tests\ConfigTest located in ./tests/Unit/ConfigTest.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:185 Class Tests\UrlTest located in ./tests/Unit/UrlTest.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:185 Class Tests\SocialAuthTest located in ./tests/Auth/SocialAuthTest.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:185 Class Tests\LdapTest located in ./tests/Auth/LdapTest.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:185 Class Tests\UserInviteTest located in ./tests/Auth/UserInviteTest.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:185 Class Tests\Saml2Test located in ./tests/Auth/Saml2Test.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:185 Class Tests\AuthTest located in ./tests/Auth/AuthTest.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:185 Class Tests\AttachmentTest located in ./tests/Uploads/AttachmentTest.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:185 Class Tests\RestrictionsTest located in ./tests/Permissions/RestrictionsTest.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:185 Class Tests\RolesTest located in ./tests/Permissions/RolesTest.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:185 Class Tests\UserProfileTest located in ./tests/User/UserProfileTest.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:185 Class Tests\UserPreferencesTest located in ./tests/User/UserPreferencesTest.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:185 Class Tests\ApiDocsTest located in ./tests/Api/ApiDocsTest.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:185 Class Tests\BooksApiTest located in ./tests/Api/BooksApiTest.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:185 Class Tests\ApiAuthTest located in ./tests/Api/ApiAuthTest.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:185 Class Tests\ApiConfigTest located in ./tests/Api/ApiConfigTest.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:185 Class Tests\ApiListingTest located in ./tests/Api/ApiListingTest.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:185 Class Tests\ExportTest located in ./tests/Entity/ExportTest.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:185 Class Tests\CommentSettingTest located in ./tests/Entity/CommentSettingTest.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:185 Class Tests\SortTest located in ./tests/Entity/SortTest.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:185 Class Tests\CommentTest located in ./tests/Entity/CommentTest.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:185 Class Tests\EntitySearchTest located in ./tests/Entity/EntitySearchTest.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:185 Class Tests\MarkdownTest located in ./tests/Entity/MarkdownTest.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:185 Class Tests\PageDraftTest located in ./tests/Entity/PageDraftTest.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:185 Class Tests\PageContentTest located in ./tests/Entity/PageContentTest.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:185 Class Tests\TagTest located in ./tests/Entity/TagTest.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:185 Class Tests\EntityTest located in ./tests/Entity/EntityTest.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:185 Class Tests\BookShelfTest located in ./tests/Entity/BookShelfTest.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:185 ``` It appears the only classes affected are in the `Tests` namespace, so this probably won't affect actually running BookStack in production.
OVERLORD added the 🔧 Maintenance:octocat: Admin/Meta labels 2026-02-05 01:16:11 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Mar 2, 2020):

You sure you're on composer 1.9.3? I had to use the unreleased 1.10.0-RC build to get these warnings to show.

Either way, Thanks for reporting! Have assigned to be addressed for the next feature release.

@ssddanbrown commented on GitHub (Mar 2, 2020): You sure you're on composer `1.9.3`? I had to use the unreleased [`1.10.0-RC`](https://github.com/composer/composer/releases/tag/1.10.0-RC) build to get these warnings to show. Either way, Thanks for reporting! Have assigned to be addressed for the next feature release.
Author
Owner

@dgw commented on GitHub (Mar 2, 2020):

We should be on composer 1.9.3, since the PHP setup action we use (shivammathur/setup-php) "always" uses the latest version, per its documentation. The last workflow run log shows composer/composer 1.9.2 being installed during the composer install step, though. Not sure if related.

@dgw commented on GitHub (Mar 2, 2020): We _should_ be on composer 1.9.3, since the PHP setup action we use ([shivammathur/setup-php](https://github.com/shivammathur/setup-php)) "always" uses the latest version, per its documentation. The last workflow run log shows `composer/composer` 1.9.2 being installed during the `composer install` step, though. Not sure if related.
Author
Owner

@ssddanbrown commented on GitHub (Mar 2, 2020):

@dgw Ah, okay, thanks. Looks like that action may have been installing pre-releases up until two days ago:
https://github.com/shivammathur/setup-php/issues/192

@ssddanbrown commented on GitHub (Mar 2, 2020): @dgw Ah, okay, thanks. Looks like that action may have been installing pre-releases up until two days ago: https://github.com/shivammathur/setup-php/issues/192
Author
Owner

@dgw commented on GitHub (Mar 2, 2020):

@ssddanbrown Confirmed the version in install log is irrelevant. Forcing a new workflow run with the latest setup-php action (the repo needed a readme anyway 😉), I don't see the deprecation warnings from composer any more. Apologies for the wrong version info; next time I'll add a "Check composer version" step to the job before reporting!

@dgw commented on GitHub (Mar 2, 2020): @ssddanbrown Confirmed the version in install log is irrelevant. Forcing a new workflow run with the latest setup-php action (the repo needed a readme anyway 😉), I don't see the deprecation warnings from composer any more. Apologies for the wrong version info; next time I'll add a "Check composer version" step to the job before reporting!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1561