Skip to content

[XML2PHP] MoneyBundle#18765

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

[XML2PHP] MoneyBundle#18765
TheMilek merged 1 commit intoSylius:2.3from
crydotsnake:xml2php/money

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

  • Chores
    • Refactored Money Bundle configuration from XML to PHP-based format for improved maintainability
    • All money formatting, currency conversion, and form functionality remains unchanged

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

coderabbitai bot commented Jan 31, 2026

📝 Walkthrough

Walkthrough

This pull request migrates Sylius MoneyBundle's service configuration from XML to PHP format. The services are moved from services.xml and services/integrations/currency.xml to their PHP equivalents, with the dependency injection extension updated to use PhpFileLoader instead of XmlFileLoader. A whitelist entry is added to the Composer require checker configuration.

Changes

Cohort / File(s) Summary
Dependency Injection Extension Update
src/Sylius/Bundle/MoneyBundle/DependencyInjection/SyliusMoneyExtension.php
Replaced XmlFileLoader with PhpFileLoader and updated configuration file paths from XML to PHP for both main services and currency integration services.
Configuration File Migration - Main Services
src/Sylius/Bundle/MoneyBundle/Resources/config/services.php, src/Sylius/Bundle/MoneyBundle/Resources/config/services.xml
Migrated services configuration from XML to PHP format. Declarations include MoneyType form service, MoneyFormatter service with interface alias, and FormatMoneyExtension Twig service.
Configuration File Migration - Currency Integration
src/Sylius/Bundle/MoneyBundle/Resources/config/services/integrations/currency.php, src/Sylius/Bundle/MoneyBundle/Resources/config/services/integrations/currency.xml
Migrated ConvertMoneyExtension Twig service configuration from XML to PHP format as a private service with currency converter dependency.
Tooling Configuration
composer-require-checker.json
Added "service" symbol to the whitelist array.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 From XML's rigid tags so strict,
To PHP's syntax, cleaner picked,
The Money flows through configs new,
With services declared in format true!

🚥 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] MoneyBundle' clearly and specifically describes the main change: converting XML configuration files to PHP format in the MoneyBundle, which is evident from all the file changes.

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

TheMilek
TheMilek previously approved these changes Feb 2, 2026
Comment on lines +28 to +30
$services->set('sylius.formatter.money', MoneyFormatter::class);

$services->alias(MoneyFormatterInterface::class, 'sylius.formatter.money');
Copy link
Copy Markdown
Contributor

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.formatter.money', MoneyFormatter::class);
$services->alias(MoneyFormatterInterface::class, 'sylius.formatter.money');
$services->set('sylius.formatter.money', MoneyFormatter::class);
$services->alias(MoneyFormatterInterface::class, 'sylius.formatter.money');

For the sake of readability, please merge the service registration with its autowireable counterpart.

Comment on lines +25 to +26
$services->set('sylius.form.type.money', MoneyType::class)
->tag('form.type');
Copy link
Copy Markdown
Contributor

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.form.type.money', MoneyType::class)
->tag('form.type');
$services
->set('sylius.form.type.money', MoneyType::class)
->tag('form.type')
;
or
$services
->set('sylius.form.type.money', MoneyType::class)
->tag('form.type');

@TheMilek TheMilek mentioned this pull request Feb 2, 2026
@TheMilek TheMilek merged commit 0c9285a into Sylius:2.3 Feb 4, 2026
35 of 36 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.

3 participants