Conversation
📝 WalkthroughWalkthroughReplaces XML DI configs with PHP equivalents in ChannelBundle: loader changed from XmlFileLoader to PhpFileLoader, XML service files removed and new PHP service files added, and Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
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:
|
|
@loic425 I assume the base branch should now be 2.3, right? |
I think so. |
09957a4 to
382d828
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@composer-require-checker.json`:
- Line 5: The entry "Datetime" in the type whitelist is incorrectly capitalized;
replace the string "Datetime" with the correct PHP built-in class name
"DateTime" so composer-require-checker recognizes the type; search for the array
containing "array", "string", ... and update the "Datetime" token to "DateTime".
In
`@src/Sylius/Bundle/ChannelBundle/Resources/config/services/integrations/debug.php`:
- Line 15: The alias for
Sylius\Bundle\ChannelBundle\Context\FakeChannel\FakeChannelCodeProviderInterface
currently inherits private visibility from its target service
'sylius.context.channel.fake_channel.code_provider', preventing type-hinted
autowiring; update the alias declaration (the $services->alias(...) line) to
make the alias public by appending ->public() so constructors expecting
FakeChannelCodeProviderInterface (e.g., FakeChannelContext,
FakeChannelPersister) can be autowired while leaving the underlying service
private.
🧹 Nitpick comments (3)
src/Sylius/Bundle/ChannelBundle/Resources/config/services/integrations/doctrine/orm.php (1)
1-8: Missingdeclare(strict_types=1);and formatting issue.Per coding guidelines, all PHP files should declare strict types. Also, add a space after
functionkeyword for consistency.Proposed fix
<?php +declare(strict_types=1); + namespace Symfony\Component\DependencyInjection\Loader\Configurator; -return static function(ContainerConfigurator $container) { +return static function (ContainerConfigurator $container): void { $parameters = $container->parameters(); $parameters->set('sylius.repository.channel.class', 'Sylius\Bundle\ChannelBundle\Doctrine\ORM\ChannelRepository'); };src/Sylius/Bundle/ChannelBundle/Resources/config/services/integrations/debug.php (1)
1-5: Missingdeclare(strict_types=1);and formatting issue.Per coding guidelines, all PHP files should declare strict types. Also, add a space after
functionkeyword and return type for consistency.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();src/Sylius/Bundle/ChannelBundle/Resources/config/services.php (1)
1-7: Missingdeclare(strict_types=1);and formatting issue.Per coding guidelines, all PHP files should declare strict types. Also, add a space after
functionkeyword and return type for consistency.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();
composer-require-checker.json
Outdated
| "null", "true", "false", | ||
| "static", "self", "parent", | ||
| "array", "string", "int", "float", "bool", "iterable", "callable", "void", "object", "mixed", "never", | ||
| "array", "string", "int", "float", "bool", "iterable", "callable", "void", "object", "mixed", "never", "Datetime", |
There was a problem hiding this comment.
Incorrect capitalization: Datetime should be DateTime.
PHP's built-in class uses PascalCase DateTime. The incorrect capitalization may cause composer-require-checker to not properly recognize DateTime usages.
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",📝 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.
| "array", "string", "int", "float", "bool", "iterable", "callable", "void", "object", "mixed", "never", "Datetime", | |
| "array", "string", "int", "float", "bool", "iterable", "callable", "void", "object", "mixed", "never", "DateTime", |
🤖 Prompt for AI Agents
In `@composer-require-checker.json` at line 5, The entry "Datetime" in the type
whitelist is incorrectly capitalized; replace the string "Datetime" with the
correct PHP built-in class name "DateTime" so composer-require-checker
recognizes the type; search for the array containing "array", "string", ... and
update the "Datetime" token to "DateTime".
| $services->set('sylius.context.channel.fake_channel.code_provider', 'Sylius\Bundle\ChannelBundle\Context\FakeChannel\FakeChannelCodeProvider') | ||
| ->private(); | ||
|
|
||
| $services->alias('Sylius\Bundle\ChannelBundle\Context\FakeChannel\FakeChannelCodeProviderInterface', 'sylius.context.channel.fake_channel.code_provider'); |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
rg "FakeChannelCodeProviderInterface" --type xml -C 3Repository: Sylius/Sylius
Length of output: 39
🏁 Script executed:
cat -n src/Sylius/Bundle/ChannelBundle/Resources/config/services/integrations/debug.phpRepository: Sylius/Sylius
Length of output: 1493
🏁 Script executed:
rg "FakeChannelCodeProviderInterface" --type php -B 2 -A 2Repository: Sylius/Sylius
Length of output: 8530
🏁 Script executed:
# Check if there are any other usages or patterns in the codebase showing how similar aliases are configured
rg "alias\(" src/Sylius/Bundle/ChannelBundle/Resources/config/services/ -A 1 -B 1Repository: Sylius/Sylius
Length of output: 460
Make the alias public to enable type-hinted autowiring.
The FakeChannelCodeProviderInterface alias inherits the private visibility from its target service, preventing type-hint based dependency injection. Since the interface is used in constructor type hints throughout the codebase (FakeChannelContext, FakeChannelPersister), make the alias public by adding ->public() to allow autowiring, while keeping the underlying service private.
🤖 Prompt for AI Agents
In
`@src/Sylius/Bundle/ChannelBundle/Resources/config/services/integrations/debug.php`
at line 15, The alias for
Sylius\Bundle\ChannelBundle\Context\FakeChannel\FakeChannelCodeProviderInterface
currently inherits private visibility from its target service
'sylius.context.channel.fake_channel.code_provider', preventing type-hinted
autowiring; update the alias declaration (the $services->alias(...) line) to
make the alias public by appending ->public() so constructors expecting
FakeChannelCodeProviderInterface (e.g., FakeChannelContext,
FakeChannelPersister) can be autowired while leaving the underlying service
private.
dd16890 to
2ecb371
Compare
2ecb371 to
2f6116e
Compare
Summary by CodeRabbit