Skip to content

[XML2PHP] ShippingBundle#18772

Merged
TheMilek merged 1 commit intoSylius:2.3from
crydotsnake:xml2php/shipping
Feb 4, 2026
Merged

[XML2PHP] ShippingBundle#18772
TheMilek merged 1 commit intoSylius:2.3from
crydotsnake:xml2php/shipping

Conversation

@crydotsnake
Copy link
Copy Markdown
Member

@crydotsnake crydotsnake commented Jan 31, 2026

Q A
Branch? 2.3
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Related tickets partially #18490
License MIT

Summary by CodeRabbit

  • Refactor

    • Shipping configuration migrated to a new DI format for cleaner maintainability.
  • New Features

    • Added shipping calculators (flat-rate, per-unit) and a delegating calculator.
    • Introduced shipping method resolvers, rule checkers (weight-based), eligibility checkers, registries, form types, validators, and a shipping date assigner — enabling new shipping rules, forms, and validation.

@crydotsnake crydotsnake requested review from a team as code owners January 31, 2026 12:08
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 31, 2026

📝 Walkthrough

Walkthrough

This pull request migrates the Sylius ShippingBundle dependency injection configuration from XML to PHP. The bundle extension now loads PHP config files (replacing XmlFileLoader with PhpFileLoader) and XML service files were removed and replaced by corresponding PHP service configuration files.

Changes

Cohort / File(s) Summary
Bundle extension
src/Sylius/Bundle/ShippingBundle/DependencyInjection/SyliusShippingExtension.php
Switched DI file loader from XmlFileLoader to PhpFileLoader and updated resource paths to load PHP config files instead of XML.
New PHP DI configs
src/Sylius/Bundle/ShippingBundle/Resources/config/services.php, .../services/checker.php, .../services/form.php, .../services/registry.php, .../services/validator.php, .../services/integrations/doctrine/orm.php
Added PHP-based service configuration files registering registries, resolvers, calculators, checkers, form types, validators, repository parameter and aliases/tags previously declared in XML.
Removed XML DI configs
src/Sylius/Bundle/ShippingBundle/Resources/config/services.xml, .../services/checker.xml, .../services/form.xml, .../services/registry.xml, .../services/validator.xml, .../services/integrations/doctrine/orm.xml
Deleted XML service configuration files that contained the shipping bundle’s service declarations, parameters, aliases and tags now moved to PHP equivalents.
Composer config
composer-require-checker.json
Added "service" to the symbol-whitelist array.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

DX, Maintenance

Suggested reviewers

  • GSadee
  • Rafikooo
  • Prometee

Poem

🐰 XML leaves fall, PHP shoots appear,
Services hop home, all tidy and clear.
Aliases snug, registries in line,
The Shipping Bundle nibbles forward—feeling fine! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: converting XML DI configuration to PHP format in the ShippingBundle.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 31, 2026

❌ Preview Environment deleted from Bunnyshell

Available commands:

  • 🚀 /bns:deploy to redeploy the environment

use Sylius\Bundle\ShippingBundle\Doctrine\ORM\ShippingMethodRepository;

return static function (ContainerConfigurator $container) {
$services = $container->services();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$services = $container->services();


return static function (ContainerConfigurator $container) {
$services = $container->services();
$parameters = $container->parameters();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$parameters = $container->parameters();


return static function (ContainerConfigurator $container) {
$services = $container->services();
$parameters = $container->parameters();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$parameters = $container->parameters();

Comment on lines +35 to +37
$services = $container->services();
$parameters = $container->parameters();
$container->import('services/**.php');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$services = $container->services();
$parameters = $container->parameters();
$container->import('services/**.php');
$container->import('services/**.php');
$parameters = $container->parameters();
$services = $container->services();

Comment on lines +41 to +45
$services->set('sylius.registry.shipping_methods_resolver', PrioritizedServiceRegistry::class)
->args([
'%sylius.shipping_methods_resolver.interface%',
'Shipping methods resolver',
]);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$services->set('sylius.registry.shipping_methods_resolver', PrioritizedServiceRegistry::class)
->args([
'%sylius.shipping_methods_resolver.interface%',
'Shipping methods resolver',
]);

this is duplicated in registry.php 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants