Skip to content

[XML2PHP] OrderBundle#18766

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

[XML2PHP] OrderBundle#18766
TheMilek merged 1 commit intoSylius:2.3from
crydotsnake:xml2php/order

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

    • Migrated OrderBundle service configuration from XML to PHP and updated the DI loader to support PHP configs.
  • New Features

    • Reintroduced order-related services and form types (order, cart, order item, cart item) with validation groups.
    • Added a Twig extension to expose aggregated order adjustments.
    • Restored expired-carts removal and cart-reset command/operations and public access points for number assignment and cart-change resetting.

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

coderabbitai bot commented Jan 31, 2026

📝 Walkthrough

Walkthrough

Migrates OrderBundle service configuration from XML to PHP (replacing XmlFileLoader with PhpFileLoader), adds new PHP DI files for services, forms, integrations, and twig, removes corresponding XML files, and adds inline_service to composer-require-checker.json symbol whitelist.

Changes

Cohort / File(s) Summary
Composer whitelist
composer-require-checker.json
Added inline_service to symbol-whitelist (placed before existing service).
Extension loader
src/Sylius/Bundle/OrderBundle/DependencyInjection/SyliusOrderExtension.php
Switched from XmlFileLoader to PhpFileLoader and updated load paths/extensions from .xml to .php for services and integration drivers.
Core services (XML → PHP)
src/Sylius/Bundle/OrderBundle/Resources/config/services.php, src/Sylius/Bundle/OrderBundle/Resources/config/services.xml
Added services.php with full DI wiring for order features (commands, contexts, processors, modifiers, generators, assigners, decorators, removers, factories); removed the old services.xml.
Form services (XML → PHP)
src/Sylius/Bundle/OrderBundle/Resources/config/services/form.php, .../services/form.xml
Added form.php defining form types, data mapper service and validation group parameters; removed form.xml.
Integrations (Doctrine) (XML → PHP)
src/Sylius/Bundle/OrderBundle/Resources/config/services/integrations/doctrine/orm.php, .../integrations/doctrine/orm.xml
Added orm.php setting repository class parameters; removed orm.xml.
Twig extension (XML → PHP)
src/Sylius/Bundle/OrderBundle/Resources/config/services/twig.php, .../services/twig.xml
Added twig.php registering sylius.twig.extension.aggregate_adjustments; removed twig.xml.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested labels

Maintenance

Suggested reviewers

  • TheMilek

Poem

🐰 I hopped through configs, XML to PHP bright,
Inline services lined up, tidy and light,
Cart crumbs and commands now wired with care,
Twig and repos awake in code fresh and fair,
A little rabbit cheers this migration flight! 🥕

🚥 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 '[XML2PHP] OrderBundle' directly describes the primary change: converting OrderBundle configuration from XML to PHP format across multiple configuration files.

✏️ 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

Comment on lines +40 to +43
$services = $container->services();
$parameters = $container->parameters();
$container->import('services/form.php');
$container->import('services/twig.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/form.php');
$container->import('services/twig.php');
$container->import('services/form.php');
$container->import('services/twig.php');
$services = $container->services();
$parameters = $container->parameters();

Comment on lines +100 to +112
$services->set('sylius.remover.expired_carts', ExpiredCartsRemover::class)
->args([
service('sylius.repository.order'),
service('sylius.manager.order'),
service('event_dispatcher'),
'%sylius_order.cart_expiration_period%',
]);

$services->alias(ExpiredCartsRemoverInterface::class, 'sylius.remover.expired_carts');

$services->set('sylius.factory.add_to_cart_command', AddToCartCommandFactory::class);

$services->alias(AddToCartCommandFactoryInterface::class, 'sylius.factory.add_to_cart_command');
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.remover.expired_carts', ExpiredCartsRemover::class)
->args([
service('sylius.repository.order'),
service('sylius.manager.order'),
service('event_dispatcher'),
'%sylius_order.cart_expiration_period%',
]);
$services->alias(ExpiredCartsRemoverInterface::class, 'sylius.remover.expired_carts');
$services->set('sylius.factory.add_to_cart_command', AddToCartCommandFactory::class);
$services->alias(AddToCartCommandFactoryInterface::class, 'sylius.factory.add_to_cart_command');
$services->set('sylius.remover.expired_carts', ExpiredCartsRemover::class)
->args([
service('sylius.repository.order'),
service('sylius.manager.order'),
service('event_dispatcher'),
'%sylius_order.cart_expiration_period%',
]);
$services->alias(ExpiredCartsRemoverInterface::class, 'sylius.remover.expired_carts');
$services->set('sylius.factory.add_to_cart_command', AddToCartCommandFactory::class);
$services->alias(AddToCartCommandFactoryInterface::class, 'sylius.factory.add_to_cart_command');

Comment on lines +114 to +118
$services->set('sylius.resetter.cart_changes', CartChangesResetter::class)
->public()
->args([service('sylius.manager.order')]);

$services->alias(CartChangesResetterInterface::class, 'sylius.resetter.cart_changes');
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.resetter.cart_changes', CartChangesResetter::class)
->public()
->args([service('sylius.manager.order')]);
$services->alias(CartChangesResetterInterface::class, 'sylius.resetter.cart_changes');
$services->set('sylius.resetter.cart_changes', CartChangesResetter::class)
->public()
->args([service('sylius.manager.order')]);
$services->alias(CartChangesResetterInterface::class, 'sylius.resetter.cart_changes');

$services->set('sylius.custom_factory.adjustment', AdjustmentFactory::class)
->private()
->decorate('sylius.factory.adjustment', null, 256)
->args([service('sylius.custom_factory.adjustment.inner')]);
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
->args([service('sylius.custom_factory.adjustment.inner')]);
->args([service('.inner')]);

@TheMilek TheMilek merged commit 2dc3adf into Sylius:2.3 Feb 4, 2026
65 of 67 checks passed
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