Conversation
📝 WalkthroughWalkthroughThe Review Bundle's service configurations are migrated from XML to PHP format. The dependency injection extension loader switches from XmlFileLoader to PhpFileLoader, and equivalent service definitions for the average rating calculator and Doctrine ORM event subscriber are relocated from XML to corresponding PHP configuration files. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
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:
|
| $parameters = $container->parameters(); | ||
|
|
||
| $services->defaults() | ||
| ->public(); | ||
|
|
||
| $services->set('sylius.doctrine.orm.event_subscriber.load_metadata.review', LoadMetadataSubscriber::class) | ||
| ->args(['%sylius.review.subjects%']) | ||
| ->tag('doctrine.event_subscriber'); |
There was a problem hiding this comment.
| $parameters = $container->parameters(); | |
| $services->defaults() | |
| ->public(); | |
| $services->set('sylius.doctrine.orm.event_subscriber.load_metadata.review', LoadMetadataSubscriber::class) | |
| ->args(['%sylius.review.subjects%']) | |
| ->tag('doctrine.event_subscriber'); | |
| $services->set('sylius.doctrine.orm.event_subscriber.load_metadata.review', LoadMetadataSubscriber::class) | |
| ->args(['%sylius.review.subjects%']) | |
| ->public() | |
| ->tag('doctrine.event_subscriber'); |
a777f94 to
9cc8d6b
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In
`@src/Sylius/Bundle/ReviewBundle/Resources/config/integrations/doctrine/orm.php`:
- Around line 18-27: The closure returned at "return static function
(ContainerConfigurator $container)" should declare a void return type to follow
the type-declaration guideline; update the anonymous function signature to
"static function (ContainerConfigurator $container): void" so the configurator
closure (the ContainerConfigurator-typed anonymous function that sets up
$services and registers
'sylius.doctrine.orm.event_subscriber.load_metadata.review') explicitly returns
void.
In `@src/Sylius/Bundle/ReviewBundle/Resources/config/services.php`:
- Around line 18-22: The closure returned from the services configurator is
missing an explicit return type; update the anonymous function signature (the
static function taking ContainerConfigurator $container in services.php that
registers 'sylius.calculator.average_rating' => AverageRatingCalculator::class)
to declare a void return type (i.e., static function (ContainerConfigurator
$container): void) so it adheres to the project's explicit return-type
guidelines.
| return static function (ContainerConfigurator $container) { | ||
| $services = $container->services(); | ||
|
|
||
| $services->defaults() | ||
| ->public(); | ||
|
|
||
| $services->set('sylius.doctrine.orm.event_subscriber.load_metadata.review', LoadMetadataSubscriber::class) | ||
| ->args(['%sylius.review.subjects%']) | ||
| ->tag('doctrine.event_subscriber'); | ||
| }; |
There was a problem hiding this comment.
Add a void return type to the configurator closure.
This keeps the config file compliant with the type declaration guideline.
✅ Suggested fix
-return static function (ContainerConfigurator $container) {
+return static function (ContainerConfigurator $container): void {📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| return static function (ContainerConfigurator $container) { | |
| $services = $container->services(); | |
| $services->defaults() | |
| ->public(); | |
| $services->set('sylius.doctrine.orm.event_subscriber.load_metadata.review', LoadMetadataSubscriber::class) | |
| ->args(['%sylius.review.subjects%']) | |
| ->tag('doctrine.event_subscriber'); | |
| }; | |
| return static function (ContainerConfigurator $container): void { | |
| $services = $container->services(); | |
| $services->defaults() | |
| ->public(); | |
| $services->set('sylius.doctrine.orm.event_subscriber.load_metadata.review', LoadMetadataSubscriber::class) | |
| ->args(['%sylius.review.subjects%']) | |
| ->tag('doctrine.event_subscriber'); | |
| }; |
🤖 Prompt for AI Agents
In
`@src/Sylius/Bundle/ReviewBundle/Resources/config/integrations/doctrine/orm.php`
around lines 18 - 27, The closure returned at "return static function
(ContainerConfigurator $container)" should declare a void return type to follow
the type-declaration guideline; update the anonymous function signature to
"static function (ContainerConfigurator $container): void" so the configurator
closure (the ContainerConfigurator-typed anonymous function that sets up
$services and registers
'sylius.doctrine.orm.event_subscriber.load_metadata.review') explicitly returns
void.
| return static function (ContainerConfigurator $container) { | ||
| $services = $container->services(); | ||
|
|
||
| $services->set('sylius.calculator.average_rating', AverageRatingCalculator::class); | ||
| }; |
There was a problem hiding this comment.
Add a void return type to the configurator closure.
Guidelines require explicit return types, and the closure currently omits it.
✅ Suggested fix
-return static function (ContainerConfigurator $container) {
+return static function (ContainerConfigurator $container): void {🤖 Prompt for AI Agents
In `@src/Sylius/Bundle/ReviewBundle/Resources/config/services.php` around lines 18
- 22, The closure returned from the services configurator is missing an explicit
return type; update the anonymous function signature (the static function taking
ContainerConfigurator $container in services.php that registers
'sylius.calculator.average_rating' => AverageRatingCalculator::class) to declare
a void return type (i.e., static function (ContainerConfigurator $container):
void) so it adheres to the project's explicit return-type guidelines.
Summary by CodeRabbit