Symfony的供应商在运行作曲家时会引起自动加载器PSR-4警告
多年来,每当我运行Composer install
时,我一直在得到这些警告:
生成优化的自动加载文件(权威)类 sensio \ bundle \ frameworkextrabundle \ tests \ depentencyInjection \ addParamConverterPasStest 位于 ./vendor/sensio/framework-extra-bundle/tests/deppentendentivection/compiler/addparamconverterpasstest.php 不符合PSR-4自动加载标准。跳过。班级 sensio \ bundle \ frameworkextrabundle \ tests \ depentencyindoction \ addexpressionLanguageProvidersPasstest 位于 ./vendor/sensio/framework-extra-bundle/tests/depperencyindoction/compiler/AddexpressionLanguageProvidersPasStest.php 不符合PSR-4自动加载标准。跳过。班级 sensio \ bundle \ frameworkextrabundle \ tests \ request \ paramconverter \ prognnnameconeconconvertertest 位于 ./vendor/sensio/framework-extra-bundle/tests/request/argumentnameconeconvertertest.php 不符合PSR-4自动加载标准。跳过。班级 Doctrine \ bundle \ migrationsBundle \ tests \ depentencyInjection \ doctrinecommandtest 位于 ./vendor/doctrine/doctrine migrations-bundle/tests/command/doctrinecommandtest.php 不符合PSR-4自动加载标准。跳过。
我如何摆脱这些供应商引起警告?
我的composer.json
:
{
"name": "...",
"description": "...",
"license": "MIT",
"type": "project",
"autoload": {
"psr-4": {
"AppBundle\\": "src/AppBundle"
},
"classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/",
"Features\\": "features/"
},
"files": [ "vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php" ]
},
"require": {
"php": "^7.2",
"aws/aws-sdk-php": "3.178.*",
"bentools/webpush-bundle": "0.6.*",
"doctrine/doctrine-bundle": "1.12.*",
"doctrine/doctrine-migrations-bundle": "1.3.*",
"doctrine/orm": "2.6.*",
"endroid/qr-code-bundle": "3.4.*",
"friendsofsymfony/jsrouting-bundle": "2.4.*",
"google/apiclient": "2.12.*",
"google/recaptcha": "1.2.*",
"incenteev/composer-parameter-handler": "2.1.*",
"knplabs/knp-time-bundle": "1.15.*",
"sensio/framework-extra-bundle": "5.2.*",
"sonata-project/admin-bundle": "3.76.0",
"sonata-project/core-bundle": "3.20.0",
"sonata-project/doctrine-orm-admin-bundle": "3.24.*",
"stripe/stripe-php": "7.102.*",
"symfony/asset": "4.4.*",
"symfony/monolog-bundle": "3.4.*",
"symfony/orm-pack": "2.2.*",
"symfony/polyfill-apcu": "1.12.*",
"symfony/swiftmailer-bundle": "3.1.*",
"symfony/symfony": "4.4.*",
"symfony/twig-bundle": "4.4.*",
"symfony/webpack-encore-bundle": "1.14.*",
"twig/cssinliner-extra": "3.3.*",
"twig/twig": "2.14.*",
"ua-parser/uap-php": "3.9.*"
},
"require-dev": {
"behat/behat": "3.7.*",
"behat/mink": "1.8.*",
"behat/mink-browserkit-driver": "1.3.*",
"behat/mink-extension": "2.3.*",
"behat/mink-goutte-driver": "1.2.1",
"behat/mink-selenium2-driver": "1.2.0",
"behat/symfony2-extension": "2.1.*",
"phpunit/phpunit": "8.5.*",
"symfony/browser-kit": "4.4.*",
"symfony/phpunit-bridge": "6.0.*",
"symfony/test-pack": "1.0.*"
},
"scripts": {
"symfony-scripts": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters"
],
"post-install-cmd": [
"@symfony-scripts"
],
"post-update-cmd": [
"@symfony-scripts"
]
},
"config": {
"platform": {
"php": "7.2.32"
},
"sort-packages": true
},
"extra": {
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "3.4-dev"
}
}
}
For years, I have been getting these warning whenever I run composer install
:
Generating optimized autoload files (authoritative) Class
Sensio\Bundle\FrameworkExtraBundle\Tests\DependencyInjection\AddParamConverterPassTest
located in
./vendor/sensio/framework-extra-bundle/Tests/DependencyInjection/Compiler/AddParamConverterPassTest.php
does not comply with psr-4 autoloading standard. Skipping. Class
Sensio\Bundle\FrameworkExtraBundle\Tests\DependencyInjection\AddExpressionLanguageProvidersPassTest
located in
./vendor/sensio/framework-extra-bundle/Tests/DependencyInjection/Compiler/AddExpressionLanguageProvidersPassTest.php
does not comply with psr-4 autoloading standard. Skipping. Class
Sensio\Bundle\FrameworkExtraBundle\Tests\Request\ParamConverter\ArgumentNameConverterTest
located in
./vendor/sensio/framework-extra-bundle/Tests/Request/ArgumentNameConverterTest.php
does not comply with psr-4 autoloading standard. Skipping. Class
Doctrine\Bundle\MigrationsBundle\Tests\DependencyInjection\DoctrineCommandTest
located in
./vendor/doctrine/doctrine-migrations-bundle/Tests/Command/DoctrineCommandTest.php
does not comply with psr-4 autoloading standard. Skipping.
How could I get rid of these vendor caused warnings?
My composer.json
:
{
"name": "...",
"description": "...",
"license": "MIT",
"type": "project",
"autoload": {
"psr-4": {
"AppBundle\\": "src/AppBundle"
},
"classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/",
"Features\\": "features/"
},
"files": [ "vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php" ]
},
"require": {
"php": "^7.2",
"aws/aws-sdk-php": "3.178.*",
"bentools/webpush-bundle": "0.6.*",
"doctrine/doctrine-bundle": "1.12.*",
"doctrine/doctrine-migrations-bundle": "1.3.*",
"doctrine/orm": "2.6.*",
"endroid/qr-code-bundle": "3.4.*",
"friendsofsymfony/jsrouting-bundle": "2.4.*",
"google/apiclient": "2.12.*",
"google/recaptcha": "1.2.*",
"incenteev/composer-parameter-handler": "2.1.*",
"knplabs/knp-time-bundle": "1.15.*",
"sensio/framework-extra-bundle": "5.2.*",
"sonata-project/admin-bundle": "3.76.0",
"sonata-project/core-bundle": "3.20.0",
"sonata-project/doctrine-orm-admin-bundle": "3.24.*",
"stripe/stripe-php": "7.102.*",
"symfony/asset": "4.4.*",
"symfony/monolog-bundle": "3.4.*",
"symfony/orm-pack": "2.2.*",
"symfony/polyfill-apcu": "1.12.*",
"symfony/swiftmailer-bundle": "3.1.*",
"symfony/symfony": "4.4.*",
"symfony/twig-bundle": "4.4.*",
"symfony/webpack-encore-bundle": "1.14.*",
"twig/cssinliner-extra": "3.3.*",
"twig/twig": "2.14.*",
"ua-parser/uap-php": "3.9.*"
},
"require-dev": {
"behat/behat": "3.7.*",
"behat/mink": "1.8.*",
"behat/mink-browserkit-driver": "1.3.*",
"behat/mink-extension": "2.3.*",
"behat/mink-goutte-driver": "1.2.1",
"behat/mink-selenium2-driver": "1.2.0",
"behat/symfony2-extension": "2.1.*",
"phpunit/phpunit": "8.5.*",
"symfony/browser-kit": "4.4.*",
"symfony/phpunit-bridge": "6.0.*",
"symfony/test-pack": "1.0.*"
},
"scripts": {
"symfony-scripts": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters"
],
"post-install-cmd": [
"@symfony-scripts"
],
"post-update-cmd": [
"@symfony-scripts"
]
},
"config": {
"platform": {
"php": "7.2.32"
},
"sort-packages": true
},
"extra": {
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "3.4-dev"
}
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果代码不在您的控制之下(供应商代码),则您将无法真正解决该问题。要么:
If the code is not under your control (vendor code), then you cannot really fix the issue. Either: