Sylius / Sylius

Open Source eCommerce Framework on Symfony
https://sylius.com
MIT License
7.86k stars 2.08k forks source link

Class doesn't comply with psr-4 autoloading standard #13074

Closed Prometee closed 2 years ago

Prometee commented 3 years ago

Sylius version affected: ^1.0

Description
When pushing a Sylius shop on a prod environment we have some warning during the dump-autoload phase of a

composer install --no-dev --prefer-dist --no-interaction --optimize-autoloader
Generating optimized autoload files
Class Sylius\Bundle\ResourceBundle\Tests\SyliusResourceBundleTest located in ./vendor/sylius/resource-bundle/src/Bundle/test/src/Tests/SyliusResourceBundleTest.php does not comply with psr-4 autoloading standard. Skipping.
Class Sylius\Bundle\ResourceBundle\Tests\ConfigurationTest located in ./vendor/sylius/resource-bundle/src/Bundle/test/src/Tests/Configuration/ConfigurationTest.php does not comply with psr-4 autoloading standard. Skipping.
Class Sylius\Bundle\ResourceBundle\Tests\DependencyInjection\SyliusResourceExtensionTest located in ./vendor/sylius/resource-bundle/src/Bundle/test/src/Tests/DependencyInjection/SyliusResourceExtensionTest.php does not com…
Class Sylius\Bundle\ResourceBundle\Tests\DependencyInjection\Compiler\RegisterResourcesPassTest located in ./vendor/sylius/resource-bundle/src/Bundle/test/src/Tests/DependencyInjection/Compiler/RegisterResourcesPassTest.ph…
Class Sylius\Bundle\ResourceBundle\Tests\DependencyInjection\Compiler\AbstractResource located in ./vendor/sylius/resource-bundle/src/Bundle/test/src/Tests/DependencyInjection/Compiler/RegisterResourcesPassTest.php does no…
Class Sylius\Bundle\ResourceBundle\Tests\DependencyInjection\Compiler\BookClass located in ./vendor/sylius/resource-bundle/src/Bundle/test/src/Tests/DependencyInjection/Compiler/RegisterResourcesPassTest.php does not compl…
Class Sylius\Bundle\ResourceBundle\Tests\DependencyInjection\Compiler\AuthorClass located in ./vendor/sylius/resource-bundle/src/Bundle/test/src/Tests/DependencyInjection/Compiler/RegisterResourcesPassTest.php does not com…
Class Sylius\Bundle\MailerBundle\Tests\SyliusMailerBundleTest located in ./vendor/sylius/mailer-bundle/src/Bundle/test/src/Tests/SyliusMailerBundleTest.php does not comply with psr-4 autoloading standard. Skipping.
Class Sylius\Bundle\PaymentBundle\Tests\SyliusPaymentBundleTest located in ./vendor/sylius/sylius/src/Sylius/Bundle/PaymentBundle/test/src/Tests/SyliusPaymentBundleTest.php does not comply with psr-4 autoloading standard. …
Class Sylius\Bundle\ReviewBundle\Tests\SyliusReviewBundleTest located in ./vendor/sylius/sylius/src/Sylius/Bundle/ReviewBundle/test/src/Tests/SyliusReviewBundleTest.php does not comply with psr-4 autoloading standard. Skip…
Class Sylius\Bundle\CurrencyBundle\Tests\SyliusCurrencyBundleTest located in ./vendor/sylius/sylius/src/Sylius/Bundle/CurrencyBundle/test/src/Tests/SyliusCurrencyBundleTest.php does not comply with psr-4 autoloading standa…
Class Sylius\Bundle\TaxationBundle\Tests\SyliusTaxationBundleTest located in ./vendor/sylius/sylius/src/Sylius/Bundle/TaxationBundle/test/src/Tests/SyliusTaxationBundleTest.php does not comply with psr-4 autoloading standa…
Class Sylius\Bundle\PromotionBundle\Tests\SyliusPromotionBundleTest located in ./vendor/sylius/sylius/src/Sylius/Bundle/PromotionBundle/test/src/Tests/SyliusPromotionBundleTest.php does not comply with psr-4 autoloading st…
Class Sylius\Bundle\ChannelBundle\Tests\SyliusChannelBundleTest located in ./vendor/sylius/sylius/src/Sylius/Bundle/ChannelBundle/test/src/Tests/SyliusChannelBundleTest.php does not comply with psr-4 autoloading standard. …
Class Sylius\Bundle\ShippingBundle\Tests\SyliusShippingBundleTest located in ./vendor/sylius/sylius/src/Sylius/Bundle/ShippingBundle/test/src/Tests/SyliusShippingBundleTest.php does not comply with psr-4 autoloading standa…
Class Sylius\Bundle\InventoryBundle\Tests\SyliusInventoryBundleTest located in ./vendor/sylius/sylius/src/Sylius/Bundle/InventoryBundle/test/src/Tests/SyliusInventoryBundleTest.php does not comply with psr-4 autoloading st…
Class Sylius\Bundle\OrderBundle\Tests\SyliusOrderBundleTest located in ./vendor/sylius/sylius/src/Sylius/Bundle/OrderBundle/test/src/Tests/SyliusOrderBundleTest.php does not comply with psr-4 autoloading standard. Skipping.
Class Sylius\Bundle\MoneyBundle\Tests\SyliusMoneyBundleTest located in ./vendor/sylius/sylius/src/Sylius/Bundle/MoneyBundle/test/src/Tests/SyliusMoneyBundleTest.php does not comply with psr-4 autoloading standard. Skipping.
Class Sylius\Bundle\ProductBundle\Tests\SyliusProductBundleTest located in ./vendor/sylius/sylius/src/Sylius/Bundle/ProductBundle/test/src/Tests/SyliusProductBundleTest.php does not comply with psr-4 autoloading standard. …
Class Sylius\Bundle\AttributeBundle\Tests\SyliusAttributeBundleTest located in ./vendor/sylius/sylius/src/Sylius/Bundle/AttributeBundle/test/src/Tests/SyliusAttributeBundleTest.php does not comply with psr-4 autoloading st…
Class Sylius\Bundle\AddressingBundle\Tests\SyliusAddressingBundleTest located in ./vendor/sylius/sylius/src/Sylius/Bundle/AddressingBundle/test/src/Tests/SyliusAddressingBundleTest.php does not comply with psr-4 autoloadin…
Class Sylius\Bundle\LocaleBundle\Tests\SyliusLocaleBundleTest located in ./vendor/sylius/sylius/src/Sylius/Bundle/LocaleBundle/test/src/Tests/SyliusLocaleBundleTest.php does not comply with psr-4 autoloading standard. Skip…
Class Sylius\Bundle\CustomerBundle\Tests\SyliusCustomerBundleTest located in ./vendor/sylius/sylius/src/Sylius/Bundle/CustomerBundle/test/src/Tests/SyliusCustomerBundleTest.php does not comply with psr-4 autoloading standa…
Class Payum\ISO4217\Tests\CurrencyTest located in ./vendor/payum/iso4217/CurrencyTest.php does not comply with psr-4 autoloading standard. Skipping.
Class Payum\ISO4217\Tests\ISO4217Test located in ./vendor/payum/iso4217/ISO4217Test.php does not comply with psr-4 autoloading standard. Skipping.
Class Payum\Be2Bill\Tests\Be2billOffsiteGatewayFactoryTest located in ./vendor/payum/payum/src/Payum/Be2Bill/Tests/Be2BillOffsiteGatewayFactoryTest.php does not comply with psr-4 autoloading standard. Skipping.

Steps to reproduce
With sylius/sylius-standard project execute composer install --no-dev --prefer-dist --no-interaction --optimize-autoloader

Possible Solution Move test folders to an upper directory or tweak the composer autoload config I guess.

Ferror commented 2 years ago

Hi! In the latest Sylius-Standard, we have only two warnings left.

https://github.com/Sylius/SyliusMailerBundle/pull/131

Class Sylius\Bundle\MailerBundle\Tests\SyliusMailerBundleTest located in ./vendor/sylius/mailer-bundle/src/Bundle/test/src/Tests/SyliusMailerBundleTest.php does not comply with psr-4 autoloading standard. Skipping.

https://github.com/Payum/Payum/issues/935

Class Payum\Be2Bill\Tests\Be2billOffsiteGatewayFactoryTest located in ./vendor/payum/payum/src/Payum/Be2Bill/Tests/Be2BillOffsiteGatewayFactoryTest.php does not comply with psr-4 autoloading standard. Skipping.
Prometee commented 2 years ago

Thank you very much for this PR @Ferror !