Conversation
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ✏️ Tip: You can disable in-progress messages and the fortune message in your review settings. 📝 WalkthroughWalkthroughReplaces XML-based Symfony DI with PHP-based DI across Sylius CoreBundle: XmlFileLoader → PhpFileLoader in the extension; removes many Changes
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
❌ Preview Environment deleted from BunnyshellAvailable commands:
|
610303d to
a6c6ed3
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
Note
Due to the large number of review comments, Critical, Major severity comments were prioritized as inline comments.
🤖 Fix all issues with AI agents
In
`@src/Sylius/Bundle/CoreBundle/Resources/config/services/installer_requirements.php`:
- Around line 9-17: The services definition for
'sylius.requirements.installer.sylius' is building the argument list with
repeated '' keys so only the last inline service (FilesystemRequirements) is
kept; update the args passed to
Sylius\Bundle\CoreBundle\Installer\Requirement\SyliusRequirements to use a
numeric array of the three inline services (SettingsRequirements,
ExtensionsRequirements, FilesystemRequirements) instead of repeated associative
'' => entries, preserving each inline_service(...) call and their
args(service('translator'), etc.) so all three requirements are included.
In
`@src/Sylius/Bundle/CoreBundle/Resources/config/services/integrations/hwi_oauth.php`:
- Around line 10-12: The service definition is passing an empty string as the
first argument where the shop user class parameter must be provided; update the
args array for the HWI OAuth provider service so the first element is the shop
user class parameter (e.g., use the parameter that resolves to
ShopUserInterface::class or %sylius.model.shop_user.class%) instead of '',
ensuring this value is passed into the parent UsernameOrEmailProvider
constructor for correct type validation and identification.
🟡 Minor comments (39)
src/Sylius/Bundle/CoreBundle/Resources/config/services/factories.php-1-3 (1)
1-3:⚠️ Potential issue | 🟡 MinorMissing
declare(strict_types=1);declaration.Per coding guidelines, all PHP files must declare
strict_types=1at the beginning.🔧 Proposed fix
<?php +declare(strict_types=1); + namespace Symfony\Component\DependencyInjection\Loader\Configurator;composer-require-checker.json-5-5 (1)
5-5:⚠️ Potential issue | 🟡 MinorFix casing:
Datetimeshould beDateTime.PHP's built-in class uses capital T (
DateTime). While PHP class names are case-insensitive at runtime, the require-checker tool may be case-sensitive when matching symbols, and consistency with the actual class name is preferred.Proposed fix
- "array", "string", "int", "float", "bool", "iterable", "callable", "void", "object", "mixed", "never", "Datetime", + "array", "string", "int", "float", "bool", "iterable", "callable", "void", "object", "mixed", "never", "DateTime",src/Sylius/Bundle/CoreBundle/Resources/config/services/payment.php-1-3 (1)
1-3:⚠️ Potential issue | 🟡 MinorMissing
declare(strict_types=1);statement.Per coding guidelines, all PHP files must declare strict types at the beginning.
🛡️ Proposed fix
<?php +declare(strict_types=1); + namespace Symfony\Component\DependencyInjection\Loader\Configurator;src/Sylius/Bundle/CoreBundle/Resources/config/services/listeners/workflow/payment.php-1-2 (1)
1-2:⚠️ Potential issue | 🟡 MinorMissing
declare(strict_types=1)statement.As per coding guidelines, all PHP files must declare
strict_types=1at the beginning.Proposed fix
<?php +declare(strict_types=1); + namespace Symfony\Component\DependencyInjection\Loader\Configurator;src/Sylius/Bundle/CoreBundle/Resources/config/services/listeners.php-1-2 (1)
1-2:⚠️ Potential issue | 🟡 MinorMissing
declare(strict_types=1)statement.As per coding guidelines, all PHP files must declare
strict_types=1at the beginning.Proposed fix
<?php +declare(strict_types=1); + namespace Symfony\Component\DependencyInjection\Loader\Configurator;src/Sylius/Bundle/CoreBundle/Resources/config/services/calculators.php-1-2 (1)
1-2:⚠️ Potential issue | 🟡 MinorMissing
declare(strict_types=1)statement.As per coding guidelines, all PHP files must declare
strict_types=1at the beginning.Proposed fix
<?php +declare(strict_types=1); + namespace Symfony\Component\DependencyInjection\Loader\Configurator;src/Sylius/Bundle/CoreBundle/Resources/config/services/order_pay/processors.php-1-2 (1)
1-2:⚠️ Potential issue | 🟡 MinorMissing
declare(strict_types=1)statement.As per coding guidelines, all PHP files must declare
strict_types=1at the beginning.Proposed fix
<?php +declare(strict_types=1); + namespace Symfony\Component\DependencyInjection\Loader\Configurator;src/Sylius/Bundle/CoreBundle/Resources/config/services/integrations/hwi_oauth.php-1-2 (1)
1-2:⚠️ Potential issue | 🟡 MinorMissing
declare(strict_types=1)statement.As per coding guidelines, all PHP files must declare
strict_types=1at the beginning.Proposed fix
<?php +declare(strict_types=1); + namespace Symfony\Component\DependencyInjection\Loader\Configurator;src/Sylius/Bundle/CoreBundle/Resources/config/services/integrations/doctrine/orm.php-1-2 (1)
1-2:⚠️ Potential issue | 🟡 MinorMissing
declare(strict_types=1)statement.As per coding guidelines, all PHP files must declare
strict_types=1at the beginning.Proposed fix
<?php +declare(strict_types=1); + namespace Symfony\Component\DependencyInjection\Loader\Configurator;src/Sylius/Bundle/CoreBundle/Resources/config/services/command_handler.php-1-5 (1)
1-5:⚠️ Potential issue | 🟡 MinorAdd strict types and an explicit void return for the configurator closure.
This file lacks
declare(strict_types=1);at the beginning, and the closure has no return type.Proposed fix
<?php +declare(strict_types=1); + namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void {As per coding guidelines: Declare
strict_types=1at the beginning of all PHP files; Add type declarations for all properties, arguments, and return values in PHP code.src/Sylius/Bundle/CoreBundle/Resources/config/services/listeners/workflow/order_shipping.php-1-5 (1)
1-5:⚠️ Potential issue | 🟡 MinorAdd strict types and an explicit void return for the configurator closure.
This file lacks
declare(strict_types=1);at the beginning, and the closure has no return type declaration.Proposed fix
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void {As per coding guidelines: Declare
strict_types=1at the beginning of all PHP files; Add type declarations for all properties, arguments, and return values in PHP code.src/Sylius/Bundle/CoreBundle/Resources/config/services/listeners/workflow/shipment.php-1-5 (1)
1-5:⚠️ Potential issue | 🟡 MinorAdd strict types and return type to the configurator closure.
This file lacks
declare(strict_types=1);and the closure has no return type declaration.Proposed fix
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void {As per coding guidelines: Declare
strict_types=1at the beginning of all PHP files; Add type declarations for all properties, arguments, and return values in PHP code.src/Sylius/Bundle/CoreBundle/Resources/config/services/listeners/workflow/order_payment.php-1-5 (1)
1-5:⚠️ Potential issue | 🟡 MinorAdd strict types and an explicit void return for the configurator closure.
This file lacks
declare(strict_types=1);, and the closure has no return type.Proposed fix
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void {Per coding guidelines: Declare
strict_types=1at the beginning of all PHP files; Add type declarations for all properties, arguments, and return values in PHP code.src/Sylius/Bundle/CoreBundle/Resources/config/services/product_variant_map.php-1-5 (1)
1-5:⚠️ Potential issue | 🟡 MinorAdd strict types and an explicit void return for the configurator closure.
This file lacks
declare(strict_types=1);and the closure has no return type. Other service configuration files in the codebase include both.Proposed fix
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void {src/Sylius/Bundle/CoreBundle/Resources/config/services/state_resolvers.php-1-5 (1)
1-5:⚠️ Potential issue | 🟡 MinorAdd
declare(strict_types=1);and an explicit: voidreturn type to the configurator closure.The file lacks
declare(strict_types=1);at the top, and the closure has no return type annotation.Proposed fix
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void {Per coding guidelines: Declare
strict_types=1at the beginning of all PHP files; Add type declarations for all properties, arguments, and return values in PHP code.src/Sylius/Bundle/CoreBundle/Resources/config/services/checkers.php-1-5 (1)
1-5:⚠️ Potential issue | 🟡 MinorAdd strict types and an explicit void return for the configurator closure.
This file lacks
declare(strict_types=1);at the beginning, and the closure has no return type declaration.Proposed fix
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void {As per coding guidelines: Declare
strict_types=1at the beginning of all PHP files; Add type declarations for all properties, arguments, and return values in PHP code.src/Sylius/Bundle/CoreBundle/Resources/config/services/catalog_promotion/checkers.php-1-6 (1)
1-6:⚠️ Potential issue | 🟡 MinorAdd
declare(strict_types=1);and explicit: voidreturn type to the config closure.This file should include
declare(strict_types=1);at the top and an explicit: voidreturn type for the closure, as required by the project's PHP coding guidelines. PHP 8.2+ fully supports both features.Proposed change
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void {src/Sylius/Bundle/CoreBundle/Resources/config/services/catalog_promotion/applicators.php-1-6 (1)
1-6:⚠️ Potential issue | 🟡 MinorAdd
declare(strict_types=1);andvoidreturn type to the configuration closure.The file is missing
declare(strict_types=1);at the beginning and the closure lacks an explicit: voidreturn type. Both violate the project's PHP coding guidelines that apply to all**/*.phpfiles. PHP 8.2 (the minimum supported version) fully supports this syntax.Proposed change
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void {src/Sylius/Bundle/CoreBundle/Resources/config/services/console_command.php-1-6 (1)
1-6:⚠️ Potential issue | 🟡 MinorAdd
declare(strict_types=1);and explicit: voidreturn type to the config closure.This file should include
declare(strict_types=1);after the opening PHP tag and add: voidreturn type to the configurator closure to comply with the project's PHP coding standards. The telemetry.php config file from the same [XML2PHP] Core migration includes these declarations, establishing the correct pattern for new config files.Proposed change
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void {src/Sylius/Bundle/CoreBundle/Resources/config/services/price_history/processors.php-1-6 (1)
1-6:⚠️ Potential issue | 🟡 MinorAdd strict_types declaration to conform with project migration efforts.
Add
declare(strict_types=1);after the opening<?phptag. The project is currently migrating all config files to include strict_types declarations. The: voidreturn type is not part of the project's established pattern for DI config closures and should not be added.Proposed change
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container) {src/Sylius/Bundle/CoreBundle/Resources/config/services/price_history.php-1-6 (1)
1-6:⚠️ Potential issue | 🟡 MinorAdd strict types and a void return type to the config closure.
The file is missing
declare(strict_types=1);and an explicit: voidreturn type on the configurator closure. Both are required by the project coding guidelines and align with Symfony DI configuration best practices.Proposed change
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void {src/Sylius/Bundle/CoreBundle/Resources/config/services/price_history/logger.php-1-1 (1)
1-1:⚠️ Potential issue | 🟡 MinorAdd
declare(strict_types=1);at the file start.Required by PHP coding guidelines for all PHP files.
🔧 Proposed fix
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator;src/Sylius/Bundle/CoreBundle/Resources/config/services/taxation.php-1-1 (1)
1-1:⚠️ Potential issue | 🟡 MinorAdd
declare(strict_types=1);at the file start.Required by PHP coding guidelines for all PHP files.
🔧 Proposed fix
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator;src/Sylius/Bundle/CoreBundle/Resources/config/services/templating.php-1-1 (1)
1-1:⚠️ Potential issue | 🟡 MinorAdd
declare(strict_types=1);at the file start.Required by PHP coding guidelines for all PHP files.
🔧 Proposed fix
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator;src/Sylius/Bundle/CoreBundle/Resources/config/services/price_history/command_dispatcher.php-1-1 (1)
1-1:⚠️ Potential issue | 🟡 MinorAdd
declare(strict_types=1);at the file start.Required by PHP coding guidelines for all PHP files.
🔧 Proposed fix
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator;src/Sylius/Bundle/CoreBundle/Resources/config/services/installer_requirements.php-1-1 (1)
1-1:⚠️ Potential issue | 🟡 MinorAdd
declare(strict_types=1);at the file start.Required by PHP coding guidelines for all PHP files.
🔧 Proposed fix
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator;src/Sylius/Bundle/CoreBundle/Resources/config/services/price_history/checkers.php-1-1 (1)
1-1:⚠️ Potential issue | 🟡 MinorAdd
declare(strict_types=1);at the file start.Required by PHP coding guidelines for all PHP files.
🔧 Proposed fix
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator;src/Sylius/Bundle/CoreBundle/Resources/config/services/price_history/command_handler.php-1-1 (1)
1-1:⚠️ Potential issue | 🟡 MinorAdd
declare(strict_types=1);at the file start.Required by PHP coding guidelines for all PHP files.
🔧 Proposed fix
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator;src/Sylius/Bundle/CoreBundle/Resources/config/services/catalog_promotion/command_handlers.php-1-37 (1)
1-37:⚠️ Potential issue | 🟡 MinorAdd
declare(strict_types=1), void return type, and use class constants for handlers.File is missing the strict types declaration at the top, the closure lacks a
voidreturn type, and handler classes are referenced as strings instead of using::classwith imports.Suggested fix
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; +use Sylius\Bundle\CoreBundle\CatalogPromotion\CommandHandler\ApplyCatalogPromotionsOnVariantsHandler; +use Sylius\Bundle\CoreBundle\CatalogPromotion\CommandHandler\DisableCatalogPromotionHandler; +use Sylius\Bundle\CoreBundle\CatalogPromotion\CommandHandler\RemoveCatalogPromotionHandler; +use Sylius\Bundle\CoreBundle\CatalogPromotion\CommandHandler\UpdateCatalogPromotionStateHandler; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void { $services = $container->services(); $parameters = $container->parameters(); - $services->set('sylius.command_handler.catalog_promotion.apply_variants', 'Sylius\Bundle\CoreBundle\CatalogPromotion\CommandHandler\ApplyCatalogPromotionsOnVariantsHandler') + $services->set('sylius.command_handler.catalog_promotion.apply_variants', ApplyCatalogPromotionsOnVariantsHandler::class) - $services->set('sylius.command_handler.catalog_promotion.disable', 'Sylius\Bundle\CoreBundle\CatalogPromotion\CommandHandler\DisableCatalogPromotionHandler') + $services->set('sylius.command_handler.catalog_promotion.disable', DisableCatalogPromotionHandler::class) - $services->set('sylius.command_handler.catalog_promotion.remove', 'Sylius\Bundle\CoreBundle\CatalogPromotion\CommandHandler\RemoveCatalogPromotionHandler') + $services->set('sylius.command_handler.catalog_promotion.remove', RemoveCatalogPromotionHandler::class) - $services->set('sylius.command_handler.catalog_promotion.update_state', 'Sylius\Bundle\CoreBundle\CatalogPromotion\CommandHandler\UpdateCatalogPromotionStateHandler') + $services->set('sylius.command_handler.catalog_promotion.update_state', UpdateCatalogPromotionStateHandler::class)src/Sylius/Bundle/CoreBundle/Resources/config/services/form.php-1-40 (1)
1-40:⚠️ Potential issue | 🟡 MinorAdd strict types declaration, return type, and use class constants instead of string class names.
The file is missing
declare(strict_types=1);at the beginning. The configurator closure lacks a return type declaration and should be: void. Service class names should use::classwithuseimports instead of string literals.Suggested fix (pattern to apply across this file)
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; +use Sylius\Bundle\CoreBundle\Form\Extension\AddressTypeExtension; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void { @@ - $services->set('sylius.form.extension.type.address', 'Sylius\Bundle\CoreBundle\Form\Extension\AddressTypeExtension') + $services->set('sylius.form.extension.type.address', AddressTypeExtension::class)Per the coding guidelines: "Declare
strict_types=1at the beginning of all PHP files", "Add type declarations for all properties, arguments, and return values in PHP code", and "Useusestatements for all non-global classes in PHP".src/Sylius/Bundle/CoreBundle/Resources/config/services.php-1-21 (1)
1-21:⚠️ Potential issue | 🟡 MinorAdd
declare(strict_types=1), avoidreturn type, anduseimports for service classes.This file is missing
declare(strict_types=1);at the top and the configurator closure lacks avoidreturn type. Additionally, service classes should be referenced using::classwithuseimports rather than string literals.🛠️ Suggested fix (pattern to apply across this file)
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; +use Sylius\Component\Core\Distributor\IntegerDistributor; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void { $services = $container->services(); $parameters = $container->parameters(); $container->import('services/*.php'); @@ - $services->set('sylius.distributor.integer', 'Sylius\Component\Core\Distributor\IntegerDistributor'); + $services->set('sylius.distributor.integer', IntegerDistributor::class);Per coding guidelines: "Declare
strict_types=1at the beginning of all PHP files", "Add type declarations for all properties, arguments, and return values in PHP code", and "Useusestatements for all non-global classes in PHP".src/Sylius/Bundle/CoreBundle/Resources/config/services/catalog_promotion.php-1-44 (1)
1-44:⚠️ Potential issue | 🟡 MinorAdd
declare(strict_types=1);,voidreturn type, and convert class references to::classwithuseimports.This configurator is missing
declare(strict_types=1);and avoidreturn type on the closure. It also uses string class names instead of::classreferences. Convert all class references to use::classwith correspondinguseimports at the top of the file.Suggested fix
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; +use Sylius\Bundle\CoreBundle\CatalogPromotion\Announcer\CatalogPromotionAnnouncer; +use Sylius\Bundle\CoreBundle\CatalogPromotion\Announcer\CatalogPromotionAnnouncerInterface; +use Sylius\Bundle\CoreBundle\CatalogPromotion\Announcer\CatalogPromotionRemovalAnnouncer; +use Sylius\Bundle\CoreBundle\CatalogPromotion\Announcer\CatalogPromotionRemovalAnnouncerInterface; +use Sylius\Bundle\CoreBundle\CatalogPromotion\CommandDispatcher\ApplyCatalogPromotionsOnVariantsCommandDispatcherInterface; +use Sylius\Bundle\CoreBundle\CatalogPromotion\CommandDispatcher\BatchedApplyCatalogPromotionsOnVariantsCommandDispatcher; +use Sylius\Bundle\CoreBundle\CatalogPromotion\DiscountApplicationCriteria\ExclusiveCriteria; +use Sylius\Bundle\CoreBundle\CatalogPromotion\DiscountApplicationCriteria\MinimumPriceCriteria; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void { $services = $container->services(); $parameters = $container->parameters(); $container->import('catalog_promotion/applicators.php'); $container->import('catalog_promotion/calculators.php'); $container->import('catalog_promotion/checkers.php'); $container->import('catalog_promotion/command_handlers.php'); $container->import('catalog_promotion/listeners.php'); $container->import('catalog_promotion/processors.php'); - $services->set('sylius.discount_application_criteria.catalog_promotion.exclusive', 'Sylius\Bundle\CoreBundle\CatalogPromotion\DiscountApplicationCriteria\ExclusiveCriteria') + $services->set('sylius.discount_application_criteria.catalog_promotion.exclusive', ExclusiveCriteria::class) ->tag('sylius.catalog_promotion.applicator_criteria'); - $services->set('sylius.discount_application_criteria.catalog_promotion.minimum_price', 'Sylius\Bundle\CoreBundle\CatalogPromotion\DiscountApplicationCriteria\MinimumPriceCriteria') + $services->set('sylius.discount_application_criteria.catalog_promotion.minimum_price', MinimumPriceCriteria::class) ->tag('sylius.catalog_promotion.applicator_criteria'); - $services->set('sylius.announcer.catalog_promotion', 'Sylius\Bundle\CoreBundle\CatalogPromotion\Announcer\CatalogPromotionAnnouncer') + $services->set('sylius.announcer.catalog_promotion', CatalogPromotionAnnouncer::class) ->public() ->args([ service('sylius.event_bus'), service('sylius.calculator.delay_stamp'), service('clock'), ]); - $services->alias('Sylius\Bundle\CoreBundle\CatalogPromotion\Announcer\CatalogPromotionAnnouncerInterface', 'sylius.announcer.catalog_promotion'); + $services->alias(CatalogPromotionAnnouncerInterface::class, 'sylius.announcer.catalog_promotion'); - $services->set('sylius.announcer.catalog_promotion.removal', 'Sylius\Bundle\CoreBundle\CatalogPromotion\Announcer\CatalogPromotionRemovalAnnouncer') + $services->set('sylius.announcer.catalog_promotion.removal', CatalogPromotionRemovalAnnouncer::class) ->public() ->args([service('sylius.command_bus')]); - $services->alias('Sylius\Bundle\CoreBundle\CatalogPromotion\Announcer\CatalogPromotionRemovalAnnouncerInterface', 'sylius.announcer.catalog_promotion.removal'); + $services->alias(CatalogPromotionRemovalAnnouncerInterface::class, 'sylius.announcer.catalog_promotion.removal'); - $services->set('sylius.command_dispatcher.catalog_promotion.batched_apply_on_variants', 'Sylius\Bundle\CoreBundle\CatalogPromotion\CommandDispatcher\BatchedApplyCatalogPromotionsOnVariantsCommandDispatcher') + $services->set('sylius.command_dispatcher.catalog_promotion.batched_apply_on_variants', BatchedApplyCatalogPromotionsOnVariantsCommandDispatcher::class) ->args([ service('sylius.command_bus'), '%sylius_core.catalog_promotions.batch_size%', ]); - $services->alias('Sylius\Bundle\CoreBundle\CatalogPromotion\CommandDispatcher\ApplyCatalogPromotionsOnVariantsCommandDispatcherInterface', 'sylius.command_dispatcher.catalog_promotion.batched_apply_on_variants'); + $services->alias(ApplyCatalogPromotionsOnVariantsCommandDispatcherInterface::class, 'sylius.command_dispatcher.catalog_promotion.batched_apply_on_variants'); };src/Sylius/Bundle/CoreBundle/Resources/config/services/catalog_promotion/processors.php-1-45 (1)
1-45:⚠️ Potential issue | 🟡 MinorAdd
declare(strict_types=1),voidreturn type, and convert processor classes to::classwith imports.This configurator is missing
declare(strict_types=1);at the top of the file, lacks avoidreturn type on the configurator closure, and uses string class names instead of::classconstants. Add the strict types declaration, the return type, and import all processor classes and interfaces with::classreferences.🛠️ Suggested fix
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; +use Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\AllProductVariantsCatalogPromotionsProcessor; +use Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\AllProductVariantsCatalogPromotionsProcessorInterface; +use Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\CatalogPromotionClearer; +use Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\CatalogPromotionClearerInterface; +use Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\CatalogPromotionRemovalProcessor; +use Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\CatalogPromotionRemovalProcessorInterface; +use Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\CatalogPromotionStateProcessor; +use Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\CatalogPromotionStateProcessorInterface; +use Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\ProductCatalogPromotionsProcessor; +use Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\ProductCatalogPromotionsProcessorInterface; +use Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\ProductVariantCatalogPromotionsProcessor; +use Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\ProductVariantCatalogPromotionsProcessorInterface; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void { @@ - $services->set('sylius.processor.catalog_promotion.all_product_variant', 'Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\AllProductVariantsCatalogPromotionsProcessor') + $services->set('sylius.processor.catalog_promotion.all_product_variant', AllProductVariantsCatalogPromotionsProcessor::class) @@ - $services->alias('Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\AllProductVariantsCatalogPromotionsProcessorInterface', 'sylius.processor.catalog_promotion.all_product_variant'); + $services->alias(AllProductVariantsCatalogPromotionsProcessorInterface::class, 'sylius.processor.catalog_promotion.all_product_variant'); @@ - $services->set('sylius.processor.catalog_promotion.clearer', 'Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\CatalogPromotionClearer'); + $services->set('sylius.processor.catalog_promotion.clearer', CatalogPromotionClearer::class); @@ - $services->alias('Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\CatalogPromotionClearerInterface', 'sylius.processor.catalog_promotion.clearer'); + $services->alias(CatalogPromotionClearerInterface::class, 'sylius.processor.catalog_promotion.clearer'); @@ - $services->set('sylius.processor.catalog_promotion.state', 'Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\CatalogPromotionStateProcessor') + $services->set('sylius.processor.catalog_promotion.state', CatalogPromotionStateProcessor::class) @@ - $services->alias('Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\CatalogPromotionStateProcessorInterface', 'sylius.processor.catalog_promotion.state'); + $services->alias(CatalogPromotionStateProcessorInterface::class, 'sylius.processor.catalog_promotion.state'); @@ - $services->set('sylius.processor.catalog_promotion.product', 'Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\ProductCatalogPromotionsProcessor') + $services->set('sylius.processor.catalog_promotion.product', ProductCatalogPromotionsProcessor::class) @@ - $services->alias('Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\ProductCatalogPromotionsProcessorInterface', 'sylius.processor.catalog_promotion.product'); + $services->alias(ProductCatalogPromotionsProcessorInterface::class, 'sylius.processor.catalog_promotion.product'); @@ - $services->set('sylius.processor.catalog_promotion.product_variant', 'Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\ProductVariantCatalogPromotionsProcessor') + $services->set('sylius.processor.catalog_promotion.product_variant', ProductVariantCatalogPromotionsProcessor::class) @@ - $services->alias('Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\ProductVariantCatalogPromotionsProcessorInterface', 'sylius.processor.catalog_promotion.product_variant'); + $services->alias(ProductVariantCatalogPromotionsProcessorInterface::class, 'sylius.processor.catalog_promotion.product_variant'); @@ - $services->set('sylius.processor.catalog_promotion.removal', 'Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\CatalogPromotionRemovalProcessor') + $services->set('sylius.processor.catalog_promotion.removal', CatalogPromotionRemovalProcessor::class) @@ - $services->alias('Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\CatalogPromotionRemovalProcessorInterface', 'sylius.processor.catalog_promotion.removal'); + $services->alias(CatalogPromotionRemovalProcessorInterface::class, 'sylius.processor.catalog_promotion.removal');src/Sylius/Bundle/CoreBundle/Resources/config/services/context.php-1-16 (1)
1-16:⚠️ Potential issue | 🟡 MinorAdd strict types, return type, and class constants to service configurator.
This file violates three coding guidelines:
- Missing
declare(strict_types=1);at the beginning- Configurator closure lacks
: voidreturn type (line 5)- Service class names are strings instead of
::classwithuseimports (lines 9, 16, 27, 35, 43, 48, 55, 62, 69, 76)Apply this pattern throughout the file:
Suggested pattern
<?php + +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; +use Sylius\Component\Channel\Context\CachedPerRequestChannelContext; +use Sylius\Component\Core\Cart\Context\ShopBasedCartContext; +use Sylius\Component\Core\Context\ShopperContext; +// ... import all other service classes + -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void { $services = $container->services(); - $services->set('sylius.context.channel.cached', 'Sylius\Component\Channel\Context\CachedPerRequestChannelContext') + $services->set('sylius.context.channel.cached', CachedPerRequestChannelContext::class)src/Sylius/Bundle/CoreBundle/Resources/config/services/validators.php-1-6 (1)
1-6:⚠️ Potential issue | 🟡 MinorAdd
declare(strict_types=1)and a: voidreturn type to the configurator closure.The coding guidelines require strict types and explicit return types on all PHP files. The
telemetry.phpservice configurator in the same directory demonstrates the correct pattern.Proposed update
<?php +declare(strict_types=1); + namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void {src/Sylius/Bundle/CoreBundle/Resources/config/services/fixtures.php-1-6 (1)
1-6:⚠️ Potential issue | 🟡 MinorAdd
strict_typesand a: voidreturn type to the configurator closure.The file lacks both
declare(strict_types=1)and an explicit return type. The sibling filesrc/Sylius/Bundle/CoreBundle/Resources/config/services/telemetry/telemetry.php(from the same modernization batch) includes both, and the project is actively adding these declarations per the coding guidelines and recent commits.🛠️ Proposed update
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void {src/Sylius/Bundle/CoreBundle/Resources/config/services/installer.php-1-6 (1)
1-6:⚠️ Potential issue | 🟡 MinorAdd
declare(strict_types=1);and the Sylius license header to this file.The file is missing the standard Sylius copyright header and
declare(strict_types=1);declaration. These are required by project guidelines for all PHP files in the codebase.🛠️ Proposed update
<?php + +/* + * This file is part of the Sylius package. + * + * (c) Sylius Sp. z o.o. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator;src/Sylius/Bundle/CoreBundle/Resources/config/services/catalog_promotion/listeners.php-1-6 (1)
1-6:⚠️ Potential issue | 🟡 MinorAdd
declare(strict_types=1)and: voidreturn type to the configurator closure.The coding guidelines require strict types and explicit return types for all PHP files. The closure should declare
voidas its return type.🛠️ Proposed update
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void {src/Sylius/Bundle/CoreBundle/Resources/config/test_services.php-1-3 (1)
1-3:⚠️ Potential issue | 🟡 MinorMissing
declare(strict_types=1);declaration.As per coding guidelines, all PHP files must declare
strict_types=1at the beginning.Proposed fix
<?php +declare(strict_types=1); + namespace Symfony\Component\DependencyInjection\Loader\Configurator;
🧹 Nitpick comments (25)
src/Sylius/Bundle/CoreBundle/Resources/config/services/factories.php (1)
7-7: Remove unused$parametersvariable.The
$parametersvariable is defined but never used in this file.♻️ Proposed fix
return static function(ContainerConfigurator $container) { $services = $container->services(); - $parameters = $container->parameters(); $services->set('sylius.custom_factory.order', 'Sylius\Bundle\CoreBundle\Factory\OrderFactory')src/Sylius/Bundle/CoreBundle/Resources/config/services/payment.php (1)
5-8: Remove unused$parametersvariable.The
$parametersvariable is declared but never used in this file.♻️ Proposed fix
-return static function(ContainerConfigurator $container) { +return static function (ContainerConfigurator $container): void { $services = $container->services(); - $parameters = $container->parameters();src/Sylius/Bundle/CoreBundle/Resources/config/services/calculators.php (1)
7-7: Unused variable$parameters.The
$parametersvariable is declared but never used in this file. Remove it to keep the code clean.Proposed fix
return static function(ContainerConfigurator $container) { $services = $container->services(); - $parameters = $container->parameters(); $services->set('sylius.calculator.delay_stamp', 'Sylius\Bundle\CoreBundle\Calculator\DelayStampCalculator');src/Sylius/Bundle/CoreBundle/Resources/config/services/order_pay/processors.php (1)
7-7: Unused variable$parameters.The
$parametersvariable is declared but never used. Remove it to keep the code clean.Proposed fix
return static function(ContainerConfigurator $container) { $services = $container->services(); - $parameters = $container->parameters(); $services->set('sylius.processor.order_pay.route_parameters', 'Sylius\Bundle\CoreBundle\OrderPay\Processor\RouteParametersProcessor')src/Sylius/Bundle/CoreBundle/Resources/config/services/listeners/workflow/payment.php (1)
7-7: Unused variable$parameters.The
$parametersvariable is declared but never used. Remove it to keep the code clean.Proposed fix
return static function(ContainerConfigurator $container) { $services = $container->services(); - $parameters = $container->parameters(); $services->set('sylius.listener.workflow.payment.process_order', 'Sylius\Bundle\CoreBundle\EventListener\Workflow\Payment\ProcessOrderListener')src/Sylius/Bundle/CoreBundle/Resources/config/services/listeners.php (1)
7-10: Unused variable and extra blank line.The
$parametersvariable is declared but never used, and there's an extra blank line after the import statement.Proposed fix
return static function(ContainerConfigurator $container) { $services = $container->services(); - $parameters = $container->parameters(); $container->import('listeners/workflow/*.php'); - $services->defaults()src/Sylius/Bundle/CoreBundle/Resources/config/services/shipping.php (2)
1-3: Missingdeclare(strict_types=1)declaration.Per coding guidelines, all PHP files should declare strict types at the beginning.
Proposed fix
<?php +declare(strict_types=1); + namespace Symfony\Component\DependencyInjection\Loader\Configurator;
5-7: Minor cleanup: unused$parametersvariable and formatting.The
$parametersvariable is declared but never used in this file. Also, there should be a space betweenfunctionand(per PSR-12 standards.Proposed fix
-return static function(ContainerConfigurator $container) { +return static function (ContainerConfigurator $container): void { $services = $container->services(); - $parameters = $container->parameters();src/Sylius/Bundle/CoreBundle/Resources/config/services/order_pay/handlers.php (1)
1-7: Missingdeclare(strict_types=1)and minor cleanup opportunities.Same issues as other DI config files: missing strict types declaration, unused
$parametersvariable, and missing space afterfunction.Proposed fix
<?php +declare(strict_types=1); + namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function (ContainerConfigurator $container): void { $services = $container->services(); - $parameters = $container->parameters();src/Sylius/Bundle/CoreBundle/Resources/config/services/mailer.php (1)
1-7: Missingdeclare(strict_types=1)and minor cleanup opportunities.Proposed fix
<?php +declare(strict_types=1); + namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function (ContainerConfigurator $container): void { $services = $container->services(); - $parameters = $container->parameters();src/Sylius/Bundle/CoreBundle/Resources/config/services/command_dispatcher.php (1)
1-7: Missingdeclare(strict_types=1)and minor cleanup opportunities.Proposed fix
<?php +declare(strict_types=1); + namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function (ContainerConfigurator $container): void { $services = $container->services(); - $parameters = $container->parameters();src/Sylius/Bundle/CoreBundle/Resources/config/services/order_pay/providers.php (1)
1-7: Missingdeclare(strict_types=1)and minor cleanup opportunities.Proposed fix
<?php +declare(strict_types=1); + namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function (ContainerConfigurator $container): void { $services = $container->services(); - $parameters = $container->parameters();src/Sylius/Bundle/CoreBundle/Resources/config/services/order_pay/controllers.php (1)
1-7: Missingdeclare(strict_types=1)and minor cleanup opportunities.Proposed fix
<?php +declare(strict_types=1); + namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function (ContainerConfigurator $container): void { $services = $container->services(); - $parameters = $container->parameters();src/Sylius/Bundle/CoreBundle/Resources/config/services/order_pay.php (1)
1-10: Missingdeclare(strict_types=1), unused variables, and trailing whitespace.This file only imports sub-configurations, so the
$servicesand$parametersvariables are unnecessary. There's also trailing whitespace on line 9.Proposed fix
<?php +declare(strict_types=1); + namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { - $services = $container->services(); - $parameters = $container->parameters(); +return static function (ContainerConfigurator $container): void { $container->import('order_pay/**/*.php'); - };src/Sylius/Bundle/CoreBundle/Resources/config/services/fixtures_factories.php (1)
1-6: Addstrict_typesand an explicitvoidreturn type to the configurator closure.These are required by the PHP coding standards used in this repo.
Suggested change
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void {As per coding guidelines: Declare
strict_types=1at the beginning of all PHP files; Add type declarations for all properties, arguments, and return values in PHP code.src/Sylius/Bundle/CoreBundle/Resources/config/services/order_processing.php (1)
1-6: Addstrict_typesand an explicitvoidreturn type to the configurator closure.Suggested change
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void {As per coding guidelines: Declare
strict_types=1at the beginning of all PHP files; Add type declarations for all properties, arguments, and return values in PHP code.src/Sylius/Bundle/CoreBundle/Resources/config/services/listeners/workflow/order.php (1)
1-6: Addstrict_typesand an explicitvoidreturn type to the configurator closure.Suggested change
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void {As per coding guidelines: Declare
strict_types=1at the beginning of all PHP files; Add type declarations for all properties, arguments, and return values in PHP code.src/Sylius/Bundle/CoreBundle/Resources/config/services/listeners/workflow/order_checkout.php (1)
1-6: Addstrict_typesand an explicitvoidreturn type to the configurator closure.Suggested change
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void {As per coding guidelines: Declare
strict_types=1at the beginning of all PHP files; Add type declarations for all properties, arguments, and return values in PHP code.src/Sylius/Bundle/CoreBundle/Resources/config/services/providers.php (1)
1-6: Addstrict_typesand an explicitvoidreturn type to the configurator closure.Suggested change
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void {As per coding guidelines: Declare
strict_types=1at the beginning of all PHP files; Add type declarations for all properties, arguments, and return values in PHP code.src/Sylius/Bundle/CoreBundle/Resources/config/services/promotion.php (2)
1-6: Addstrict_typesand an explicitvoidreturn type to the configurator closure.Suggested change
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void {As per coding guidelines: Declare
strict_types=1at the beginning of all PHP files; Add type declarations for all properties, arguments, and return values in PHP code.
26-93: Alphabetize tag metadata array keys (form_type, label, type) for consistency.Several tag metadata arrays use non-alphabetical key order (e.g.,
type,label,form_type). Please reorder these keys consistently across the file.Example adjustment
- ->tag('sylius.promotion_rule_checker', ['type' => 'customer_group', 'label' => 'sylius.form.promotion_rule.customer_group', 'form_type' => 'Sylius\Bundle\CoreBundle\Form\Type\Promotion\Rule\CustomerGroupConfigurationType']); + ->tag('sylius.promotion_rule_checker', ['form_type' => 'Sylius\Bundle\CoreBundle\Form\Type\Promotion\Rule\CustomerGroupConfigurationType', 'label' => 'sylius.form.promotion_rule.customer_group', 'type' => 'customer_group']);As per coding guidelines: Order PHP array keys alphabetically where applicable.
src/Sylius/Bundle/CoreBundle/Resources/config/services/catalog_promotion/calculators.php (1)
1-6: Addstrict_typesand an explicitvoidreturn type to the configurator closure.Suggested change
<?php +declare(strict_types=1); namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function(ContainerConfigurator $container): void {As per coding guidelines: Declare
strict_types=1at the beginning of all PHP files; Add type declarations for all properties, arguments, and return values in PHP code.src/Sylius/Bundle/CoreBundle/Resources/config/services/taxation.php (1)
49-56: Order tag attribute keys alphabetically.Guidelines require alphabetical ordering of array keys; use
labelbeforetype.♻️ Proposed fix
- ->tag('sylius.taxation.calculation_strategy', ['type' => 'order_items_based', 'label' => 'Order items based']); + ->tag('sylius.taxation.calculation_strategy', ['label' => 'Order items based', 'type' => 'order_items_based']); @@ - ->tag('sylius.taxation.calculation_strategy', ['type' => 'order_item_units_based', 'label' => 'Order item units based']); + ->tag('sylius.taxation.calculation_strategy', ['label' => 'Order item units based', 'type' => 'order_item_units_based']);src/Sylius/Bundle/CoreBundle/Resources/config/services/price_history/listeners.php (1)
28-30: Order doctrine event listener tag keys alphabetically.Keep tag option keys in alphabetical order for consistency.
♻️ Proposed adjustment
- ->tag('doctrine.event_listener', ['event' => 'postPersist', 'priority' => 500, 'connection' => 'default']); + ->tag('doctrine.event_listener', ['connection' => 'default', 'event' => 'postPersist', 'priority' => 500]);Please confirm the team’s style expectations for tag option ordering. As per coding guidelines: Order PHP array keys alphabetically where applicable.
src/Sylius/Bundle/CoreBundle/Resources/config/test_services.php (1)
7-7: Unused variable$parameters.This variable is assigned but never used in the file. Consider removing it to avoid dead code.
Proposed fix
return static function(ContainerConfigurator $container) { $services = $container->services(); - $parameters = $container->parameters(); $services->defaults()
src/Sylius/Bundle/CoreBundle/Resources/config/services/installer_requirements.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/CoreBundle/Resources/config/services/integrations/hwi_oauth.php
Show resolved
Hide resolved
713d40e to
39310bd
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@src/Sylius/Bundle/CoreBundle/Resources/config/services.php`:
- Line 416: Change the incorrect interface name
OrdersTotalsProvidersRegistryInterface to the correct
OrdersTotalsProviderRegistryInterface in this file: update the import (currently
referencing OrdersTotalsProvidersRegistryInterface) and update the service alias
call $services->alias(...) to use OrdersTotalsProviderRegistryInterface; the
concrete class OrdersTotalsProvidersRegistry already implements
OrdersTotalsProviderRegistryInterface so ensure the alias and import match that
interface name exactly.
In
`@src/Sylius/Bundle/CoreBundle/Resources/config/services/integrations/hwi_oauth.php`:
- Around line 21-33: The service definition for 'sylius.oauth.user_provider'
(UserProvider::class) is missing public visibility; update the service
registration where $services->set('sylius.oauth.user_provider',
UserProvider::class) is called to make the service public by adding ->public()
(e.g. place ->public() before ->lazy()), so the provider remains accessible to
HWIOAuthBundle and other consumers.
🧹 Nitpick comments (15)
src/Sylius/Bundle/CoreBundle/Resources/config/services/factories.php (1)
19-21: Remove unused$parametersvariable.
$parametersis assigned on line 21 but never referenced in this file. This is likely a leftover from a copy-paste template.♻️ Proposed fix
return static function (ContainerConfigurator $container) { $services = $container->services(); - $parameters = $container->parameters(); $services->set('sylius.custom_factory.order', OrderFactory::class)src/Sylius/Bundle/CoreBundle/Resources/config/services/product_variant_map.php (1)
26-26: Unused$parametersvariable.
$parametersis assigned but never referenced. Remove it to keep the file clean.🧹 Proposed fix
$services = $container->services(); - $parameters = $container->parameters();src/Sylius/Bundle/CoreBundle/Resources/config/services/validators.php (1)
46-48: Unused$parametersvariable.
$parametersis assigned on line 48 but never referenced anywhere in this file. Remove it to keep the config clean.🧹 Remove unused variable
return static function (ContainerConfigurator $container) { $services = $container->services(); - $parameters = $container->parameters(); $services->set('sylius.validator.has_enabled_entity', HasEnabledEntityValidator::class)src/Sylius/Bundle/CoreBundle/Resources/config/services/mailer.php (1)
32-32: Unused$parametersvariable.
$parametersis assigned but never referenced in this file.Suggested fix
return static function (ContainerConfigurator $container) { $services = $container->services(); - $parameters = $container->parameters();src/Sylius/Bundle/CoreBundle/Resources/config/services/listeners/workflow/order_shipping.php (1)
20-20: Remove unused$parametersvariable.
$parametersis assigned but never used in this file. This is part of a wider pattern across 43+ PHP DI config files in this PR where the variable is declared but unused. Consider removing it.♻️ Suggested fix
$services = $container->services(); - $parameters = $container->parameters();src/Sylius/Bundle/CoreBundle/Resources/config/services/installer_requirements.php (1)
23-23: Remove unused$parametersvariable.
$parametersis assigned but never referenced in this file.♻️ Suggested fix
$services = $container->services(); - $parameters = $container->parameters();src/Sylius/Bundle/CoreBundle/Resources/config/test_services.php (1)
21-21: Unused$parametersvariable.
$parametersis assigned but never referenced in this file. Remove the dead assignment.Proposed fix
return static function (ContainerConfigurator $container) { $services = $container->services(); - $parameters = $container->parameters(); $services->defaults()src/Sylius/Bundle/CoreBundle/Resources/config/services/order_pay/controllers.php (1)
22-22: Unused$parametersvariable.
$parametersis assigned but never referenced in this file. Consider removing it to keep the config clean.♻️ Suggested fix
$services = $container->services(); - $parameters = $container->parameters();src/Sylius/Bundle/CoreBundle/Resources/config/services/order_pay/providers.php (1)
24-24: Unused$parametersvariable.Same as in the controllers config —
$parametersis assigned but never used.♻️ Suggested fix
$services = $container->services(); - $parameters = $container->parameters();src/Sylius/Bundle/CoreBundle/Resources/config/services/form.php (2)
91-95: Catalog promotion parameters defined in form config.The parameters on lines 91–95 (
sylius.catalog_promotion.action.*,sylius.catalog_promotion.scope.*) are catalog promotion type constants rather than form-specific config. They're only here because the form type tags reference them. If there's a dedicatedcatalog_promotion.phpconfig file in this PR, consider defining these parameters there and relying on container parameter resolution at tag-attribute evaluation time — this would improve cohesion. Not blocking if this mirrors the original XML layout.
21-22: Minor: import ordering nit.
ProductsToCodesTransformershould precedeProductVariantsToCodesTransformeralphabetically.Proposed fix
-use Sylius\Bundle\CoreBundle\Form\DataTransformer\ProductVariantsToCodesTransformer; use Sylius\Bundle\CoreBundle\Form\DataTransformer\ProductsToCodesTransformer; +use Sylius\Bundle\CoreBundle\Form\DataTransformer\ProductVariantsToCodesTransformer; use Sylius\Bundle\CoreBundle\Form\DataTransformer\TaxonsToCodesTransformer;As per coding guidelines: "Sort PHP
useimports alphabetically and group by type (classes, functions, constants)".src/Sylius/Bundle/CoreBundle/Resources/config/services/templating.php (1)
24-24: Unused$parametersvariable.
$parametersis assigned but never used in this file. This pattern appears across multiple new config files in this PR. Consider removing it where unused, or if it's intentionally kept as a boilerplate for future additions, that's acceptable too.src/Sylius/Bundle/CoreBundle/Resources/config/services.php (1)
279-281: Service IDsylius.assigner.customer_idrefers toCustomerIpAssigner.The ID says
customer_idbut the class isCustomerIpAssigner(IP assigner). This is likely a legacy naming carried over from the XML config, but it's worth noting for future cleanup.src/Sylius/Bundle/CoreBundle/Resources/config/services/calculators.php (1)
19-26: Unused$parametersvariable across all new config files.
$parametersis assigned on line 21 but never referenced. The same pattern appears in every new file in this PR. While this may be intentional boilerplate for future use, it adds unnecessary noise.♻️ Suggested fix
return static function (ContainerConfigurator $container) { $services = $container->services(); - $parameters = $container->parameters(); $services->set('sylius.calculator.delay_stamp', DelayStampCalculator::class);src/Sylius/Bundle/CoreBundle/Resources/config/services/price_history/listeners.php (1)
22-24: Unused$parametersvariable.
$parametersis assigned on line 24 but never referenced in this file. This pattern appears to be copied across multiple config files in this PR.Proposed fix
return static function (ContainerConfigurator $container) { $services = $container->services(); - $parameters = $container->parameters();
| $services->set('sylius.oauth.user_provider', UserProvider::class) | ||
| ->lazy() | ||
| ->args([ | ||
| '%sylius.model.shop_user.class%', | ||
| service('sylius.factory.customer'), | ||
| service('sylius.factory.shop_user'), | ||
| service('sylius.repository.shop_user'), | ||
| service('sylius.factory.oauth_user'), | ||
| service('sylius.repository.oauth_user'), | ||
| service('sylius.manager.shop_user'), | ||
| service('sylius.canonicalizer'), | ||
| service('sylius.repository.customer'), | ||
| ]); |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# 1. Find the commit that deleted the XML file
COMMIT=$(git log --all --oneline --diff-filter=D -- "**/integrations/hwi_oauth.xml" | head -1 | awk '{print $1}')
if [ -n "$COMMIT" ]; then
echo "=== Original XML content (commit ${COMMIT}) ==="
git show "${COMMIT}^:src/Sylius/Bundle/CoreBundle/Resources/config/services/integrations/hwi_oauth.xml" 2>/dev/null || echo "File not found"
echo ""
fi
# 2. Check other PHP config files in the same directory for ->public() usage
echo "=== PHP config files in services/integrations/ with ->public() calls ==="
fd -type f -name "*.php" src/Sylius/Bundle/CoreBundle/Resources/config/services/integrations/ --exec grep -l "public()" {} \;
echo ""
# 3. Check a few PHP config files to see the pattern
echo "=== Sample PHP config files ==="
fd -type f -name "*.php" src/Sylius/Bundle/CoreBundle/Resources/config/services/ -type f | head -3 | while read f; do
echo "File: $f"
grep -A5 "->set(" "$f" | head -20
echo ""
done
# 4. Look for references to sylius.oauth.user_provider in config files
echo "=== References to sylius.oauth.user_provider in config ==="
rg -n "sylius.oauth.user_provider" --type yaml --type xml src/Sylius/Bundle/CoreBundle/Resources/config/ 2>/dev/null | head -20Repository: Sylius/Sylius
Length of output: 580
🏁 Script executed:
#!/bin/bash
# 1. Search for hwi_oauth.xml file (may still exist or in git history)
echo "=== Searching for hwi_oauth.xml ==="
find . -name "*hwi_oauth.xml" 2>/dev/null
echo ""
# 2. Check git history for this file
echo "=== Git history for hwi_oauth.xml ==="
git log --all --oneline -- "*hwi_oauth.xml" | head -5
echo ""
# 3. Look for the most recent version of the XML file before it was replaced
echo "=== Looking for original XML content in git ==="
git show HEAD~10:src/Sylius/Bundle/CoreBundle/Resources/config/services/integrations/hwi_oauth.xml 2>/dev/null | head -50
echo ""
# 4. Check PHP config files in integrations directory
echo "=== PHP files in integrations directory ==="
find src/Sylius/Bundle/CoreBundle/Resources/config/services/integrations/ -name "*.php" 2>/dev/null | head -10
echo ""
# 5. Sample from one of the config files to see the pattern
echo "=== Sample from a PHP config file ==="
find src/Sylius/Bundle/CoreBundle/Resources/config/services/ -name "*.php" -type f 2>/dev/null | head -1 | xargs head -60
echo ""
# 6. Search for references to sylius.oauth.user_provider using rg
echo "=== References to oauth.user_provider ==="
rg "oauth.user_provider" src/Sylius/Bundle/CoreBundle/Resources/ 2>/dev/null | head -20
echo ""
# 7. Check if hwi_oauth.php exists and verify the entire file
echo "=== Current hwi_oauth.php content ==="
cat src/Sylius/Bundle/CoreBundle/Resources/config/services/integrations/hwi_oauth.phpRepository: Sylius/Sylius
Length of output: 2694
🏁 Script executed:
#!/bin/bash
# 1. Check the commit that says "Make all Sylius services public"
echo "=== Commit: Make all Sylius services public ==="
git show cc00d97bd9 --stat | head -50
echo ""
# 2. Check if hwi_oauth.php or hwi_oauth.xml was modified in that commit
echo "=== Checking if hwi_oauth files are in that commit ==="
git show cc00d97bd9 -- "*hwi_oauth*" 2>/dev/null | head -100
echo ""
# 3. Get the detailed commit for the HWI OAuth adjustment
echo "=== Commit: c269961cdd HWI OAuth UserProvider service adjustment ==="
git show c269961cdd --stat | head -30
echo ""
# 4. Show the actual changes in that commit
echo "=== Changes in c269961cdd ==="
git show c269961cdd 2>/dev/null | head -150
echo ""
# 5. Check the commit message for more context
echo "=== Full commit message for c269961cdd ==="
git log -1 --format='%B' c269961cddRepository: Sylius/Sylius
Length of output: 6127
🏁 Script executed:
#!/bin/bash
# Find when hwi_oauth.xml was deleted/replaced with PHP
echo "=== Commits affecting hwi_oauth files ==="
git log --oneline --all -- "*hwi_oauth.xml" "*hwi_oauth.php" | head -20
echo ""
# Show the commit that introduced hwi_oauth.php
echo "=== Commit that introduced hwi_oauth.php ==="
git log --oneline --all -- "src/Sylius/Bundle/CoreBundle/Resources/config/services/integrations/hwi_oauth.php" | head -5
echo ""
# Get the full commit that converted XML to PHP (the most recent one)
COMMIT=$(git log --oneline --all -- "src/Sylius/Bundle/CoreBundle/Resources/config/services/integrations/hwi_oauth.php" | head -1 | awk '{print $1}')
echo "=== Full diff for conversion commit $COMMIT ==="
git show $COMMIT 2>/dev/null | head -200
echo ""
# Check if the original XML file still exists or was deleted
echo "=== Status of hwi_oauth.xml ==="
git log --oneline --diff-filter=D -- "*hwi_oauth.xml" | head -3Repository: Sylius/Sylius
Length of output: 7318
🏁 Script executed:
#!/bin/bash
# Check the full current hwi_oauth.php to see if there's any defaults() call
echo "=== Full hwi_oauth.php content ==="
cat -n src/Sylius/Bundle/CoreBundle/Resources/config/services/integrations/hwi_oauth.php
echo ""
# Check if the XML still exists or was completely removed
echo "=== Check for deleted XML in git history ==="
git log --all --diff-filter=D -- "*hwi_oauth.xml" --oneline | head -5Repository: Sylius/Sylius
Length of output: 1401
Add ->public() to the service definition.
The original XML file declared <defaults public="true" /> (commit cc00d97), making this service publicly accessible. When converting to PHP, this must be preserved by calling ->public() on the service.
$services->set('sylius.oauth.user_provider', UserProvider::class)
->public()
->lazy()
->args([
Without this, the service is private and will not be accessible to HWIOAuthBundle or other components that reference it directly.
🤖 Prompt for AI Agents
In
`@src/Sylius/Bundle/CoreBundle/Resources/config/services/integrations/hwi_oauth.php`
around lines 21 - 33, The service definition for 'sylius.oauth.user_provider'
(UserProvider::class) is missing public visibility; update the service
registration where $services->set('sylius.oauth.user_provider',
UserProvider::class) is called to make the service public by adding ->public()
(e.g. place ->public() before ->lazy()), so the provider remains accessible to
HWIOAuthBundle and other consumers.
39310bd to
9165053
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@src/Sylius/Bundle/CoreBundle/Resources/config/services.php`:
- Around line 100-103: The services.php import only globs services/*.php and is
missing the intermediate import files needed to pull in nested directories; add
two new intermediate files named services/integrations.php and
services/telemetry.php that each perform a ContainerConfigurator import of their
respective subdirectory (e.g., integrations/*.php and telemetry/*.php) so that
the files under services/integrations/ (doctrine/orm.php, hwi_oauth.php) and
services/telemetry/ (telemetry.php) are loaded when services.php runs.
In `@src/Sylius/Bundle/CoreBundle/Resources/config/services/promotion.php`:
- Around line 115-123: The service definition for
sylius.command.promotion_action.unit_fixed_discount passes five args to
UnitFixedDiscountPromotionActionCommand but its constructor accepts only four;
remove the fifth argument service('sylius.converter.currency') from the
->args([...]) array so the service only injects
service('sylius.factory.adjustment'),
service('sylius.filter.promotion.price_range'),
service('sylius.filter.promotion.taxon'), and
service('sylius.filter.promotion.product') to match the
UnitFixedDiscountPromotionActionCommand constructor.
🧹 Nitpick comments (13)
src/Sylius/Bundle/CoreBundle/Resources/config/services/installer_requirements.php (1)
23-23: Remove unused$parametersvariable.
$parametersis assigned but never referenced in this file.♻️ Proposed fix
$services = $container->services(); - $parameters = $container->parameters();src/Sylius/Bundle/CoreBundle/Resources/config/services/factories.php (1)
21-21: Unused variable$parameters.
$container->parameters()is assigned but never referenced in this file. The payment.php file in this same PR doesn't include it, so this appears to be leftover boilerplate.Proposed fix
return static function (ContainerConfigurator $container) { $services = $container->services(); - $parameters = $container->parameters(); $services->set('sylius.custom_factory.order', OrderFactory::class)src/Sylius/Bundle/CoreBundle/Resources/config/services/listeners/workflow/shipment.php (1)
21-21: Remove unused$parametersvariable.
$parametersis assigned but never referenced in this file — likely a copy-paste artifact from a template.🧹 Proposed fix
return static function (ContainerConfigurator $container) { $services = $container->services(); - $parameters = $container->parameters(); $services->set('sylius.listener.workflow.shipment.resolve_order_shipment_state', ResolveOrderShipmentStateListener::class)src/Sylius/Bundle/CoreBundle/Resources/config/services/mailer.php (1)
32-32: Unused$parametersvariable.
$parametersis assigned but never referenced in this file. Remove it to keep the configuration clean.♻️ Suggested fix
$services = $container->services(); - $parameters = $container->parameters();src/Sylius/Bundle/CoreBundle/Resources/config/services/listeners.php (1)
41-41: Unused$parametersvariable.
$parametersis assigned but never referenced anywhere in this file.Proposed fix
$services = $container->services(); - $parameters = $container->parameters(); $container->import('listeners/workflow/*.php');src/Sylius/Bundle/CoreBundle/Resources/config/services/promotion.php (1)
62-62: Unused$parametersvariable.
$container->parameters()is assigned but never referenced in this file.Proposed fix
$services = $container->services(); - $parameters = $container->parameters();src/Sylius/Bundle/CoreBundle/Resources/config/services/telemetry/telemetry.php (1)
46-46: Inconsistent: voidreturn type on closure.This is the only DI config file in the PR that adds
: voidto the closure signature. All others (e.g.,templating.php,services.php,state_resolvers.php,payment.php,order_shipping.php) omit it. Consider aligning for consistency.Suggested diff
-return static function (ContainerConfigurator $container): void { +return static function (ContainerConfigurator $container) {src/Sylius/Bundle/CoreBundle/Resources/config/services/listeners/workflow/order_payment.php (1)
19-30: Unused$parametersvariable.
$parametersis assigned on line 21 but never referenced. This pattern repeats across all new config files in this PR.Proposed fix
return static function (ContainerConfigurator $container) { $services = $container->services(); - $parameters = $container->parameters(); $services->set('sylius.listener.workflow.order_payment.sell_order_inventory', SellOrderInventoryListener::class)src/Sylius/Bundle/CoreBundle/Resources/config/services/fixtures_listeners.php (1)
23-24: The->public()default has no effect since both services explicitly call->private(). Either remove the default or remove the per-service->private()calls.Option A: Remove the unused default
- $services->defaults() - ->public(); - - $services->set('sylius.fixture.listener.catalog_promotion_executor', CatalogPromotionExecutorListener::class) - ->private() + $services->set('sylius.fixture.listener.catalog_promotion_executor', CatalogPromotionExecutorListener::class)(and likewise remove
->private()from the images_purger service)Option B: Keep default private, drop per-service overrides
- $services->defaults() - ->public(); - - $services->set('sylius.fixture.listener.catalog_promotion_executor', CatalogPromotionExecutorListener::class) - ->private() + $services->set('sylius.fixture.listener.catalog_promotion_executor', CatalogPromotionExecutorListener::class)src/Sylius/Bundle/CoreBundle/Resources/config/services/price_history/logger.php (1)
19-31: Unused$parametersvariable.
$parametersis assigned on line 21 but never used in this file. This pattern appears to be repeated across multiple files in this PR. Consider removing it from files where it's not needed to keep the configuration clean.♻️ Suggested fix
return static function (ContainerConfigurator $container) { $services = $container->services(); - $parameters = $container->parameters(); $services->set('sylius.logger.price_history.price_change', PriceChangeLogger::class)src/Sylius/Bundle/CoreBundle/Resources/config/services/command_handler.php (1)
23-24: Unused$parametersvariable.
$parametersis assigned but never used in this file. This pattern repeats across several new config files in this PR (e.g.,context.php,catalog_promotion/listeners.php,listeners/workflow/order.php). Consider removing these unused assignments for clarity.Suggested fix
$services = $container->services(); - $parameters = $container->parameters();src/Sylius/Bundle/CoreBundle/Resources/config/services/order_processing.php (1)
29-31: Consider breaking long parameter definitions across multiple lines for readability.Line 31 is quite long. While functionally correct, wrapping the array elements would improve readability and make diffs cleaner.
Suggested formatting
- $parameters->set('sylius.order_processing.adjustment_clearing_types', [AdjustmentInterface::ORDER_ITEM_PROMOTION_ADJUSTMENT, AdjustmentInterface::ORDER_PROMOTION_ADJUSTMENT, AdjustmentInterface::ORDER_SHIPPING_PROMOTION_ADJUSTMENT, AdjustmentInterface::ORDER_UNIT_PROMOTION_ADJUSTMENT, AdjustmentInterface::SHIPPING_ADJUSTMENT, AdjustmentInterface::TAX_ADJUSTMENT]); + $parameters->set('sylius.order_processing.adjustment_clearing_types', [ + AdjustmentInterface::ORDER_ITEM_PROMOTION_ADJUSTMENT, + AdjustmentInterface::ORDER_PROMOTION_ADJUSTMENT, + AdjustmentInterface::ORDER_SHIPPING_PROMOTION_ADJUSTMENT, + AdjustmentInterface::ORDER_UNIT_PROMOTION_ADJUSTMENT, + AdjustmentInterface::SHIPPING_ADJUSTMENT, + AdjustmentInterface::TAX_ADJUSTMENT, + ]);src/Sylius/Bundle/CoreBundle/Resources/config/services/fixtures.php (1)
44-44: Remove unused$parametersvariable.
$parametersis assigned but never referenced anywhere in this file.Proposed fix
$services = $container->services(); - $parameters = $container->parameters();
| return static function (ContainerConfigurator $container) { | ||
| $services = $container->services(); | ||
| $parameters = $container->parameters(); | ||
| $container->import('services/*.php'); |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify that all service subdirectories have an intermediate import file
# in the services/ directory that imports their contents.
echo "=== PHP files directly in services/ (matched by services/*.php glob) ==="
fd --type f --max-depth 1 -e php . src/Sylius/Bundle/CoreBundle/Resources/config/services/
echo ""
echo "=== Subdirectories in services/ ==="
fd --type d --max-depth 1 . src/Sylius/Bundle/CoreBundle/Resources/config/services/
echo ""
echo "=== Checking for import() calls in top-level service files ==="
rg -n 'import\(' src/Sylius/Bundle/CoreBundle/Resources/config/services/*.php 2>/dev/null || echo "No import calls found in top-level service files"
echo ""
echo "=== All PHP config files in services/ tree ==="
fd --type f -e php . src/Sylius/Bundle/CoreBundle/Resources/config/services/ | sortRepository: Sylius/Sylius
Length of output: 8866
Missing intermediate import files for integrations/ and telemetry/ subdirectories.
The services/*.php glob pattern correctly chains to subdirectories via intermediate import files (catalog_promotion.php, listeners.php, order_pay.php, price_history.php). However, two subdirectories are not imported:
services/integrations/(containsdoctrine/orm.php,hwi_oauth.php) — needsservices/integrations.phpservices/telemetry/(containstelemetry.php) — needsservices/telemetry.php
Services in these directories will not be loaded. Create the missing intermediate files to chain-import their contents.
🤖 Prompt for AI Agents
In `@src/Sylius/Bundle/CoreBundle/Resources/config/services.php` around lines 100
- 103, The services.php import only globs services/*.php and is missing the
intermediate import files needed to pull in nested directories; add two new
intermediate files named services/integrations.php and services/telemetry.php
that each perform a ContainerConfigurator import of their respective
subdirectory (e.g., integrations/*.php and telemetry/*.php) so that the files
under services/integrations/ (doctrine/orm.php, hwi_oauth.php) and
services/telemetry/ (telemetry.php) are loaded when services.php runs.
9165053 to
21ca56e
Compare
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Fix all issues with AI agents
In
`@src/Sylius/Bundle/CoreBundle/Resources/config/services/listeners/workflow/order_payment.php`:
- Line 21: Remove the unused assignment to $parameters that calls
$container->parameters(): delete the line containing "$parameters =
$container->parameters();" (it is never referenced anywhere in this DI config).
Ensure no other logic depends on $parameters; if any future use is intended,
reference $container->parameters() directly where needed instead of keeping the
unused variable.
In
`@src/Sylius/Bundle/CoreBundle/Resources/config/services/price_history/listeners.php`:
- Around line 26-47: The OnFlushEntityObserverListener contains a typo using
$mail->isEntityChanged(...) instead of the instance method; update the call in
OnFlushEntityObserverListener (where it invokes isEntityChanged) to use
$this->isEntityChanged(...) so the listener correctly calls its own method
(ensure any other similar incorrect $mail or wrong-variable references in that
class are corrected to $this).
In
`@src/Sylius/Bundle/CoreBundle/Resources/config/services/product_variant_map.php`:
- Line 26: The variable $parameters is declared but never used in
product_variant_map.php; remove the unused declaration ($parameters =
$container->parameters();) to eliminate dead code and avoid warnings. Locate the
line that assigns $parameters and delete it, ensuring no other code references
$parameters afterwards and that the file still returns/uses $container as
intended.
In `@src/Sylius/Bundle/CoreBundle/Resources/config/services/promotion.php`:
- Around line 106-113: The service definition for
sylius.command.promotion_action.fixed_discount is passing four constructor args
but FixedDiscountPromotionActionCommand only accepts three; remove the fourth
argument (service('sylius.converter.currency')) from the ->args([...]) array so
the args list only includes service('sylius.distributor.proportional_integer'),
service('sylius.applicator.promotion.units_adjustments'), and
service('sylius.distributor.minimum_price') to match the
FixedDiscountPromotionActionCommand constructor signature.
🧹 Nitpick comments (19)
src/Sylius/Bundle/CoreBundle/Resources/config/services/installer_requirements.php (1)
23-23:$parametersis assigned but never used.This variable is dead code in this file — consider removing it.
♻️ Suggested fix
$services = $container->services(); - $parameters = $container->parameters();src/Sylius/Bundle/CoreBundle/Resources/config/services/listeners/workflow/order_shipping.php (1)
20-20: Unused$parametersvariable.
$parametersis assigned but never referenced in this file. Remove it to keep the configuration clean.🧹 Suggested fix
return static function (ContainerConfigurator $container) { $services = $container->services(); - $parameters = $container->parameters(); $services->set('sylius.listener.workflow.order_shipping.resolve_order_state', ResolveOrderStateListener::class)src/Sylius/Bundle/CoreBundle/Resources/config/services/mailer.php (1)
30-32: Unused$parametersvariable.
$parametersis assigned on line 32 but never referenced anywhere in this file. Remove it to keep the configuration clean.♻️ Proposed fix
return static function (ContainerConfigurator $container) { $services = $container->services(); - $parameters = $container->parameters();src/Sylius/Bundle/CoreBundle/Resources/config/services/context.php (1)
31-31: Unused$parametersvariable.
$parametersis assigned but never referenced in this file. Remove it to avoid dead code.Proposed fix
$services = $container->services(); - $parameters = $container->parameters();src/Sylius/Bundle/CoreBundle/Resources/config/services/taxation.php (1)
62-74: Nit: order tag attribute keys alphabetically.As per coding guidelines, array keys should be ordered alphabetically where applicable.
'label'should precede'type'.Proposed fix
$services->set('sylius.strategy.taxation.tax_calculation.order_items_based', TaxCalculationStrategy::class) ->args([ 'order_items_based', tagged_iterator('sylius.taxation.items.applicator'), ]) - ->tag('sylius.taxation.calculation_strategy', ['type' => 'order_items_based', 'label' => 'Order items based']); + ->tag('sylius.taxation.calculation_strategy', ['label' => 'Order items based', 'type' => 'order_items_based']); $services->set('sylius.strategy.taxation.tax_calculation.order_item_units_based', TaxCalculationStrategy::class) ->args([ 'order_item_units_based', tagged_iterator('sylius.taxation.item_units.applicator'), ]) - ->tag('sylius.taxation.calculation_strategy', ['type' => 'order_item_units_based', 'label' => 'Order item units based']); + ->tag('sylius.taxation.calculation_strategy', ['label' => 'Order item units based', 'type' => 'order_item_units_based']);As per coding guidelines: "Order PHP array keys alphabetically where applicable".
src/Sylius/Bundle/CoreBundle/Resources/config/services/listeners.php (1)
41-41: Unused$parametersvariable.
$parametersis assigned but never referenced in this file. Remove it to avoid dead code.🧹 Suggested fix
$services = $container->services(); - $parameters = $container->parameters(); $container->import('listeners/workflow/*.php');src/Sylius/Bundle/CoreBundle/Resources/config/services/fixtures_factories.php (1)
41-46: Unused$parametersvariable.
$parametersis assigned on line 43 but never referenced anywhere in this file. Consider removing it.🧹 Suggested fix
return static function (ContainerConfigurator $container) { $services = $container->services(); - $parameters = $container->parameters(); $services->defaults() ->public();src/Sylius/Bundle/CoreBundle/Resources/config/services/fixtures.php (1)
42-44: Unused$parametersvariable.Same as in
fixtures_factories.php—$parametersis assigned but never used.🧹 Suggested fix
return static function (ContainerConfigurator $container) { $services = $container->services(); - $parameters = $container->parameters();src/Sylius/Bundle/CoreBundle/Resources/config/services/promotion.php (1)
62-62: Unused$parametersvariable.
$container->parameters()is called and assigned but never referenced in this file. Remove it to avoid dead code.Suggested fix
$services = $container->services(); - $parameters = $container->parameters();src/Sylius/Bundle/CoreBundle/Resources/config/services/listeners/workflow/order_checkout.php (1)
25-25: Unused$parametersvariable.
$parametersis assigned but never referenced in this file. Likely a copy-paste artifact.🧹 Suggested removal
$services = $container->services(); - $parameters = $container->parameters();src/Sylius/Bundle/CoreBundle/Resources/config/services/catalog_promotion/checkers.php (1)
24-26: Unused$parametersvariable.
$parametersis assigned on Line 26 but never referenced in this file.🧹 Suggested fix
return static function (ContainerConfigurator $container) { $services = $container->services(); - $parameters = $container->parameters();src/Sylius/Bundle/CoreBundle/Resources/config/services/catalog_promotion/calculators.php (1)
21-23: Unused$parametersvariable — same as incheckers.php.🧹 Suggested fix
return static function (ContainerConfigurator $container) { $services = $container->services(); - $parameters = $container->parameters();src/Sylius/Bundle/CoreBundle/Resources/config/services/catalog_promotion/processors.php (1)
29-31: Unused$parametersvariable — same pattern as other files in this PR.src/Sylius/Bundle/CoreBundle/Resources/config/services/order_pay/providers.php (1)
22-24: Unused$parametersvariable.src/Sylius/Bundle/CoreBundle/Resources/config/services/console_command.php (1)
28-30: Unused$parametersvariable.src/Sylius/Bundle/CoreBundle/Resources/config/services/checkers.php (1)
25-27: Unused$parametersvariable.src/Sylius/Bundle/CoreBundle/Resources/config/services/order_processing.php (1)
29-31: Consider splitting the long parameter lines for readability.Lines 29–31, especially line 31 with six
AdjustmentInterface::*constants, are quite wide. Breaking them into multi-line arrays would improve readability and make diffs cleaner.♻️ Suggested formatting
- $parameters->set('sylius.order_payment_processor.checkout.unsupported_states', [OrderInterface::STATE_CANCELLED, OrderInterface::STATE_FULFILLED]); - $parameters->set('sylius.order_payment_processor.after_checkout.unsupported_states', [OrderInterface::STATE_CANCELLED, OrderInterface::STATE_FULFILLED]); - $parameters->set('sylius.order_processing.adjustment_clearing_types', [AdjustmentInterface::ORDER_ITEM_PROMOTION_ADJUSTMENT, AdjustmentInterface::ORDER_PROMOTION_ADJUSTMENT, AdjustmentInterface::ORDER_SHIPPING_PROMOTION_ADJUSTMENT, AdjustmentInterface::ORDER_UNIT_PROMOTION_ADJUSTMENT, AdjustmentInterface::SHIPPING_ADJUSTMENT, AdjustmentInterface::TAX_ADJUSTMENT]); + $parameters->set('sylius.order_payment_processor.checkout.unsupported_states', [ + OrderInterface::STATE_CANCELLED, + OrderInterface::STATE_FULFILLED, + ]); + $parameters->set('sylius.order_payment_processor.after_checkout.unsupported_states', [ + OrderInterface::STATE_CANCELLED, + OrderInterface::STATE_FULFILLED, + ]); + $parameters->set('sylius.order_processing.adjustment_clearing_types', [ + AdjustmentInterface::ORDER_ITEM_PROMOTION_ADJUSTMENT, + AdjustmentInterface::ORDER_PROMOTION_ADJUSTMENT, + AdjustmentInterface::ORDER_SHIPPING_PROMOTION_ADJUSTMENT, + AdjustmentInterface::ORDER_UNIT_PROMOTION_ADJUSTMENT, + AdjustmentInterface::SHIPPING_ADJUSTMENT, + AdjustmentInterface::TAX_ADJUSTMENT, + ]);As per coding guidelines, use trailing commas in multi-line PHP arrays.
src/Sylius/Bundle/CoreBundle/Resources/config/services/catalog_promotion/listeners.php (1)
30-30: Unused$parametersvariable.
$parametersis assigned but never referenced in this file. Remove it to keep the config clean.♻️ Proposed fix
$services = $container->services(); - $parameters = $container->parameters();src/Sylius/Bundle/CoreBundle/Resources/config/services/price_history/listeners.php (1)
24-24: Unused$parametersvariable.Same as in
catalog_promotion/listeners.php—$parametersis assigned but never used.♻️ Proposed fix
$services = $container->services(); - $parameters = $container->parameters();
src/Sylius/Bundle/CoreBundle/Resources/config/services/listeners/workflow/order_payment.php
Outdated
Show resolved
Hide resolved
| $services->set('sylius.entity_observer.price_history.create_log_entry_on_price_change', CreateLogEntryOnPriceChangeObserver::class) | ||
| ->args([service('sylius.logger.price_history.price_change')]) | ||
| ->tag('sylius.entity_observer'); | ||
|
|
||
| $services->set('sylius.entity_observer.price_history.process_lowest_prices_on_channel_change', ProcessLowestPricesOnChannelChangeObserver::class) | ||
| ->args([service('sylius.command_dispatcher.price_history.batched_apply_lowest_price_on_channel_pricings')]) | ||
| ->tag('sylius.entity_observer'); | ||
|
|
||
| $services->set('sylius.entity_observer.price_history.process_lowest_prices_on_channel_price_history_config_change', ProcessLowestPricesOnChannelPriceHistoryConfigChangeObserver::class) | ||
| ->args([ | ||
| service('sylius.repository.channel'), | ||
| service('sylius.command_dispatcher.price_history.batched_apply_lowest_price_on_channel_pricings'), | ||
| ]) | ||
| ->tag('sylius.entity_observer'); | ||
|
|
||
| $services->set('sylius.listener.price_history.on_flush_entity_observer', OnFlushEntityObserverListener::class) | ||
| ->args([tagged_iterator('sylius.entity_observer')]) | ||
| ->tag('doctrine.event_listener', ['event' => 'onFlush', 'lazy' => true]); | ||
|
|
||
| $services->set('sylius.listener.price_history.channel_pricing_log_entry', ChannelPricingLogEntryEventListener::class) | ||
| ->args([service('sylius.processor.price_history.product_lowest_price_before_discount')]) | ||
| ->tag('doctrine.event_listener', ['event' => 'postPersist', 'priority' => 500, 'connection' => 'default']); |
There was a problem hiding this comment.
Service wiring matches constructor signatures.
Verified against the relevant code snippets:
ProcessLowestPricesOnChannelChangeObservertakes oneApplyLowestPriceOnChannelPricingsCommandDispatcherInterfacearg ✓ProcessLowestPricesOnChannelPriceHistoryConfigChangeObservertakesChannelRepositoryInterface+ command dispatcher ✓OnFlushEntityObserverListenertakesiterable $entityObserversviatagged_iterator('sylius.entity_observer')✓
Note: The relevant snippet for OnFlushEntityObserverListener (at OnFlushEntityObserverListener.php line ~47) contains $mail->isEntityChanged(...) which appears to be a typo for $this->isEntityChanged(...). This would cause a runtime error when the listener fires. While not part of this DI config file, the listener wired here would fail.
#!/bin/bash
# Verify the $mail typo in OnFlushEntityObserverListener
fd "OnFlushEntityObserverListener.php" --type f --exec cat {}🤖 Prompt for AI Agents
In
`@src/Sylius/Bundle/CoreBundle/Resources/config/services/price_history/listeners.php`
around lines 26 - 47, The OnFlushEntityObserverListener contains a typo using
$mail->isEntityChanged(...) instead of the instance method; update the call in
OnFlushEntityObserverListener (where it invokes isEntityChanged) to use
$this->isEntityChanged(...) so the listener correctly calls its own method
(ensure any other similar incorrect $mail or wrong-variable references in that
class are corrected to $this).
src/Sylius/Bundle/CoreBundle/Resources/config/services/product_variant_map.php
Outdated
Show resolved
Hide resolved
21ca56e to
b51d182
Compare
Summary by CodeRabbit
Chores
New Features