Skip to content

[XML2PHP] CurrencyBundle#18761

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

[XML2PHP] CurrencyBundle#18761
TheMilek merged 1 commit intoSylius:2.3from
crydotsnake:xml2php/currency

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
    • Currency bundle configuration structure has been updated.

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

coderabbitai bot commented Jan 31, 2026

📝 Walkthrough

Walkthrough

This PR converts the CurrencyBundle's Symfony DependencyInjection configuration from XML format to PHP format. The extension class loader switches from XmlFileLoader to PhpFileLoader, and all service definition files are migrated from .xml to .php equivalents with identical service declarations.

Changes

Cohort / File(s) Summary
DependencyInjection Extension
src/Sylius/Bundle/CurrencyBundle/DependencyInjection/SyliusCurrencyExtension.php
Replaces XmlFileLoader with PhpFileLoader and updates all config file paths from .xml to .php for both driver-specific and general services.
Core Services Configuration
src/Sylius/Bundle/CurrencyBundle/Resources/config/services.php, src/Sylius/Bundle/CurrencyBundle/Resources/config/services.xml
Migrates core service definitions including CompositeCurrencyContext, CurrencyConverter, CurrencyNameConverter, Twig extension, and validators from XML to PHP format.
Form Services Configuration
src/Sylius/Bundle/CurrencyBundle/Resources/config/services/form.php, src/Sylius/Bundle/CurrencyBundle/Resources/config/services/form.xml
Converts form type service definitions (CurrencyType, CurrencyChoiceType, ExchangeRateType) and validation group parameters from XML to PHP.
Doctrine ORM Integration
src/Sylius/Bundle/CurrencyBundle/Resources/config/services/integrations/doctrine/orm.php, src/Sylius/Bundle/CurrencyBundle/Resources/config/services/integrations/doctrine/orm.xml
Migrates ExchangeRateRepository parameter configuration from XML to PHP format.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

Maintenance

Suggested reviewers

  • TheMilek
  • GSadee

Poem

🐰 XML files hopped away with a bound,
PHP configs took their place, safe and sound!
Currency services now dance in PHP's embrace,
DependencyInjection—a more modern space! ✨

🚥 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] CurrencyBundle' accurately describes the primary change: converting XML configuration files to PHP format in the CurrencyBundle.

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

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Fix all issues with AI agents
In
`@src/Sylius/Bundle/CurrencyBundle/DependencyInjection/SyliusCurrencyExtension.php`:
- Around line 26-35: The load method in SyliusCurrencyExtension loads
services/integrations/<driver>.php but there is no integration file for the
declared DRIVER_DOCTRINE_MONGODB_ODM in getSupportedDrivers(), which will break
container compilation when the mongodb-odm driver is selected; either add an
integration services file for the 'doctrine/mongodb-odm' driver (create a
services/integrations/doctrine/mongodb-odm.php next to the existing doctrine/orm
integration and register the equivalent MongoDB ODM service definitions and
resource mappings used by registerResources) or remove
DRIVER_DOCTRINE_MONGODB_ODM from getSupportedDrivers() if MongoDB ODM is not
supported. Ensure the created file exports the expected service IDs used by the
bundle and matches the driver string used by SyliusCurrencyExtension::load.

In `@src/Sylius/Bundle/CurrencyBundle/Resources/config/services.php`:
- Around line 1-41: Add a file-level strict types declaration and a void return
type for the exported config closure: insert declare(strict_types=1) at the top
of the file and change the returned anonymous function signature from "static
function (ContainerConfigurator $container)" to "static function
(ContainerConfigurator $container): void" so it complies with PHP coding
guidelines; update the closure signature referenced as the returned static
function in this services.php file.

In `@src/Sylius/Bundle/CurrencyBundle/Resources/config/services/form.php`:
- Around line 1-32: Add a strict types declaration and an explicit void return
type on the returned config closure: insert declare(strict_types=1); immediately
after the opening <?php tag, and change the closure signature from "return
static function (ContainerConfigurator $container)" to "return static function
(ContainerConfigurator $container): void" so the file follows the project's PHP
strict typing and function return-type rules (refer to the returned closure in
this file).

In
`@src/Sylius/Bundle/CurrencyBundle/Resources/config/services/integrations/doctrine/orm.php`:
- Around line 1-11: Add a strict types declaration and a void return type on the
config closure: at the top of the file add declare(strict_types=1); after the
opening <?php, and change the exported closure signature from "return static
function (ContainerConfigurator $container)" to "return static function
(ContainerConfigurator $container): void" so the file follows PHP guidelines;
update any references to the closure (the returned static function using
ContainerConfigurator) accordingly.

Comment on lines 26 to +35
public function load(array $configs, ContainerBuilder $container): void
{
$config = $this->processConfiguration($this->getConfiguration([], $container), $configs);
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader = new PhpFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));

$loader->load(sprintf('services/integrations/%s.xml', $config['driver']));
$loader->load(sprintf('services/integrations/%s.php', $config['driver']));

$this->registerResources('sylius', $config['driver'], $config['resources'], $container);

$loader->load('services.xml');
$loader->load('services.php');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find Configuration.php in CurrencyBundle
cfg=$(fd -t f 'Configuration.php' src/Sylius/Bundle/CurrencyBundle)
echo "=== Configuration.php location ==="
echo "$cfg"
echo ""

if [ -n "$cfg" ]; then
  echo "=== Driver configuration in Configuration.php ==="
  rg -n "driver" "$cfg" -A 2 -B 2
  echo ""
fi

# List available integration PHP configs
echo "=== Available integration PHP config files ==="
fd -t f -e php 'services/integrations' src/Sylius/Bundle/CurrencyBundle/Resources/config 2>/dev/null || echo "No integration config files found"
echo ""

# Also check the structure of Resources/config
echo "=== Full structure of Resources/config ==="
fd -t f 'Resources/config' src/Sylius/Bundle/CurrencyBundle | head -20

Repository: Sylius/Sylius

Length of output: 513


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find the value of DRIVER_DOCTRINE_ORM constant
echo "=== SyliusResourceBundle DRIVER constants ==="
rg -n "DRIVER_DOCTRINE_ORM|const DRIVER" --type php -B 1 -A 1 | grep -E "(DRIVER|=|const)" | head -20
echo ""

# Check if services/integrations directory exists
echo "=== Check services/integrations directory ==="
if [ -d "src/Sylius/Bundle/CurrencyBundle/Resources/config/services/integrations" ]; then
  echo "Directory EXISTS. Contents:"
  ls -la "src/Sylius/Bundle/CurrencyBundle/Resources/config/services/integrations"
else
  echo "Directory DOES NOT EXIST"
fi
echo ""

# Check what's in services directory
echo "=== Contents of services directory ==="
ls -la "src/Sylius/Bundle/CurrencyBundle/Resources/config/services/" 2>/dev/null || echo "services/ directory not found"
echo ""

# Look for any config files by extension
echo "=== All config files in Resources/config ==="
find "src/Sylius/Bundle/CurrencyBundle/Resources/config" -type f 2>/dev/null || echo "No files found"

Repository: Sylius/Sylius

Length of output: 2972


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find DRIVER constant definitions
echo "=== DRIVER constant definitions in SyliusResourceBundle ==="
find . -name "SyliusResourceBundle.php" -type f | xargs rg -n "DRIVER_DOCTRINE" -A 1 -B 1 2>/dev/null | head -30
echo ""

# Check the CurrencyBundle configuration
echo "=== SyliusCurrencyBundle.php content ==="
cat -n "src/Sylius/Bundle/CurrencyBundle/SyliusCurrencyBundle.php"
echo ""

# List ALL files in Resources/config directory (recursive)
echo "=== All files in Resources/config (recursive) ==="
find "src/Sylius/Bundle/CurrencyBundle/Resources/config" -type f 2>/dev/null

Repository: Sylius/Sylius

Length of output: 4650


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find the actual definition of DRIVER_DOCTRINE_ORM and DRIVER_DOCTRINE_MONGODB_ODM constants
echo "=== SyliusResourceBundle constant definitions ==="
rg -n "const DRIVER_DOCTRINE" src/Sylius/Bundle/ResourceBundle/SyliusResourceBundle.php -A 0
echo ""

# Verify the missing MongoDB ODM integration file
echo "=== Check for MongoDB ODM integration file ==="
if [ -f "src/Sylius/Bundle/CurrencyBundle/Resources/config/services/integrations/doctrine/mongodb-odm.php" ]; then
  echo "File EXISTS"
else
  echo "File DOES NOT EXIST - This is a PROBLEM"
fi
echo ""

# Show what integration files DO exist
echo "=== Integration files that DO exist ==="
find "src/Sylius/Bundle/CurrencyBundle/Resources/config/services/integrations" -type f

Repository: Sylius/Sylius

Length of output: 221


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find SyliusResourceBundle.php
echo "=== Searching for SyliusResourceBundle.php ==="
find . -name "SyliusResourceBundle.php" -type f
echo ""

# Also check what driver value is being loaded
echo "=== Looking at actual SyliusResourceBundle location and constants ==="
resource_bundle=$(find . -name "SyliusResourceBundle.php" -type f | head -1)
if [ -n "$resource_bundle" ]; then
  rg -n "const DRIVER" "$resource_bundle"
fi
echo ""

# Verify the missing MongoDB ODM integration file
echo "=== Check for MongoDB ODM integration file ==="
if [ -f "src/Sylius/Bundle/CurrencyBundle/Resources/config/services/integrations/doctrine/mongodb-odm.php" ]; then
  echo "File EXISTS"
else
  echo "File DOES NOT EXIST"
fi
echo ""

# Show what integration files DO exist
echo "=== Integration files that exist ==="
find "src/Sylius/Bundle/CurrencyBundle/Resources/config/services/integrations" -type f

Repository: Sylius/Sylius

Length of output: 369


Critical: Missing MongoDB ODM integration config file.

The code loads services/integrations/<driver>.php, but the bundle declares support for both DRIVER_DOCTRINE_ORM and DRIVER_DOCTRINE_MONGODB_ODM in getSupportedDrivers(). The file services/integrations/doctrine/mongodb-odm.php does not exist; only doctrine/orm.php exists. If MongoDB ODM is configured, the container build will fail.

Create src/Sylius/Bundle/CurrencyBundle/Resources/config/services/integrations/doctrine/mongodb-odm.php with appropriate service definitions for MongoDB ODM, or remove DRIVER_DOCTRINE_MONGODB_ODM from getSupportedDrivers() if not intended to be supported.

🤖 Prompt for AI Agents
In
`@src/Sylius/Bundle/CurrencyBundle/DependencyInjection/SyliusCurrencyExtension.php`
around lines 26 - 35, The load method in SyliusCurrencyExtension loads
services/integrations/<driver>.php but there is no integration file for the
declared DRIVER_DOCTRINE_MONGODB_ODM in getSupportedDrivers(), which will break
container compilation when the mongodb-odm driver is selected; either add an
integration services file for the 'doctrine/mongodb-odm' driver (create a
services/integrations/doctrine/mongodb-odm.php next to the existing doctrine/orm
integration and register the equivalent MongoDB ODM service definitions and
resource mappings used by registerResources) or remove
DRIVER_DOCTRINE_MONGODB_ODM from getSupportedDrivers() if MongoDB ODM is not
supported. Ensure the created file exports the expected service IDs used by the
bundle and matches the driver string used by SyliusCurrencyExtension::load.

Comment on lines +1 to +41
<?php

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Sylius\Bundle\CurrencyBundle\Twig\CurrencyExtension;
use Sylius\Bundle\CurrencyBundle\Validator\Constraints\DifferentSourceTargetCurrencyValidator;
use Sylius\Bundle\CurrencyBundle\Validator\Constraints\UniqueCurrencyPairValidator;
use Sylius\Component\Currency\Context\CompositeCurrencyContext;
use Sylius\Component\Currency\Converter\CurrencyConverter;
use Sylius\Component\Currency\Converter\CurrencyConverterInterface;
use Sylius\Component\Currency\Converter\CurrencyNameConverter;
use Sylius\Component\Currency\Converter\CurrencyNameConverterInterface;

return static function (ContainerConfigurator $container) {
$services = $container->services();
$parameters = $container->parameters();
$container->import('services/form.php');


$services->set('sylius.context.currency.composite', CompositeCurrencyContext::class)
->decorate('sylius.context.currency', null, 256);

$services->set('sylius.converter.currency', CurrencyConverter::class)
->args([service('sylius.repository.exchange_rate')]);

$services->alias(CurrencyConverterInterface::class, 'sylius.converter.currency');

$services->set('sylius.converter.currency_name', CurrencyNameConverter::class);

$services->alias(CurrencyNameConverterInterface::class, 'sylius.converter.currency_name');

$services->set('sylius.twig.extension.currency', CurrencyExtension::class)
->tag('twig.extension');

$services->set('sylius.validator.different_source_target_currency', DifferentSourceTargetCurrencyValidator::class)
->tag('validator.constraint_validator');

$services->set('sylius.validator.unique_currency_pair', UniqueCurrencyPairValidator::class)
->args([service('sylius.repository.exchange_rate')])
->tag('validator.constraint_validator');
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

cat -n src/Sylius/Bundle/CurrencyBundle/Resources/config/services.php

Repository: Sylius/Sylius

Length of output: 2218


Add declare(strict_types=1) and a void return type for the config closure.

Required by the PHP coding guidelines.

🔧 Proposed fix
 <?php
+declare(strict_types=1);

 namespace Symfony\Component\DependencyInjection\Loader\Configurator;
@@
-return static function (ContainerConfigurator $container) {
+return static function (ContainerConfigurator $container): void {
🤖 Prompt for AI Agents
In `@src/Sylius/Bundle/CurrencyBundle/Resources/config/services.php` around lines
1 - 41, Add a file-level strict types declaration and a void return type for the
exported config closure: insert declare(strict_types=1) at the top of the file
and change the returned anonymous function signature from "static function
(ContainerConfigurator $container)" to "static function (ContainerConfigurator
$container): void" so it complies with PHP coding guidelines; update the closure
signature referenced as the returned static function in this services.php file.

Comment on lines +1 to +32
<?php

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Sylius\Bundle\CurrencyBundle\Form\Type\CurrencyChoiceType;
use Sylius\Bundle\CurrencyBundle\Form\Type\CurrencyType;
use Sylius\Bundle\CurrencyBundle\Form\Type\ExchangeRateType;

return static function (ContainerConfigurator $container) {
$services = $container->services();
$parameters = $container->parameters();
$parameters->set('sylius.form.type.currency.validation_groups', ['sylius']);
$parameters->set('sylius.form.type.exchange_rate.validation_groups', ['sylius']);

$services->set('sylius.form.type.currency', CurrencyType::class)
->args([
'%sylius.model.currency.class%',
'%sylius.form.type.currency.validation_groups%',
])
->tag('form.type');

$services->set('sylius.form.type.currency_choice', CurrencyChoiceType::class)
->args([service('sylius.repository.currency')])
->tag('form.type');

$services->set('sylius.form.type.exchange_rate', ExchangeRateType::class)
->args([
'%sylius.model.exchange_rate.class%',
'%sylius.form.type.exchange_rate.validation_groups%',
])
->tag('form.type');
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if the file exists and read its current contents
if [ -f "src/Sylius/Bundle/CurrencyBundle/Resources/config/services/form.php" ]; then
    echo "=== File found, reading contents ==="
    cat -n "src/Sylius/Bundle/CurrencyBundle/Resources/config/services/form.php"
else
    echo "File not found at expected path"
    # Try to find it
    find . -name "form.php" -path "*CurrencyBundle*" -type f 2>/dev/null
fi

Repository: Sylius/Sylius

Length of output: 1540


Add declare(strict_types=1) and a void return type for the config closure.

Both are required by the PHP coding guidelines: all PHP files must declare strict_types=1 at the beginning, and all functions must have type declarations for return values.

🔧 Proposed fix
 <?php
+declare(strict_types=1);
 
 namespace Symfony\Component\DependencyInjection\Loader\Configurator;
 
 use Sylius\Bundle\CurrencyBundle\Form\Type\CurrencyChoiceType;
 use Sylius\Bundle\CurrencyBundle\Form\Type\CurrencyType;
 use Sylius\Bundle\CurrencyBundle\Form\Type\ExchangeRateType;
 
-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.

Suggested change
<?php
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
use Sylius\Bundle\CurrencyBundle\Form\Type\CurrencyChoiceType;
use Sylius\Bundle\CurrencyBundle\Form\Type\CurrencyType;
use Sylius\Bundle\CurrencyBundle\Form\Type\ExchangeRateType;
return static function (ContainerConfigurator $container) {
$services = $container->services();
$parameters = $container->parameters();
$parameters->set('sylius.form.type.currency.validation_groups', ['sylius']);
$parameters->set('sylius.form.type.exchange_rate.validation_groups', ['sylius']);
$services->set('sylius.form.type.currency', CurrencyType::class)
->args([
'%sylius.model.currency.class%',
'%sylius.form.type.currency.validation_groups%',
])
->tag('form.type');
$services->set('sylius.form.type.currency_choice', CurrencyChoiceType::class)
->args([service('sylius.repository.currency')])
->tag('form.type');
$services->set('sylius.form.type.exchange_rate', ExchangeRateType::class)
->args([
'%sylius.model.exchange_rate.class%',
'%sylius.form.type.exchange_rate.validation_groups%',
])
->tag('form.type');
};
<?php
declare(strict_types=1);
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
use Sylius\Bundle\CurrencyBundle\Form\Type\CurrencyChoiceType;
use Sylius\Bundle\CurrencyBundle\Form\Type\CurrencyType;
use Sylius\Bundle\CurrencyBundle\Form\Type\ExchangeRateType;
return static function (ContainerConfigurator $container): void {
$services = $container->services();
$parameters = $container->parameters();
$parameters->set('sylius.form.type.currency.validation_groups', ['sylius']);
$parameters->set('sylius.form.type.exchange_rate.validation_groups', ['sylius']);
$services->set('sylius.form.type.currency', CurrencyType::class)
->args([
'%sylius.model.currency.class%',
'%sylius.form.type.currency.validation_groups%',
])
->tag('form.type');
$services->set('sylius.form.type.currency_choice', CurrencyChoiceType::class)
->args([service('sylius.repository.currency')])
->tag('form.type');
$services->set('sylius.form.type.exchange_rate', ExchangeRateType::class)
->args([
'%sylius.model.exchange_rate.class%',
'%sylius.form.type.exchange_rate.validation_groups%',
])
->tag('form.type');
};
🤖 Prompt for AI Agents
In `@src/Sylius/Bundle/CurrencyBundle/Resources/config/services/form.php` around
lines 1 - 32, Add a strict types declaration and an explicit void return type on
the returned config closure: insert declare(strict_types=1); immediately after
the opening <?php tag, and change the closure signature from "return static
function (ContainerConfigurator $container)" to "return static function
(ContainerConfigurator $container): void" so the file follows the project's PHP
strict typing and function return-type rules (refer to the returned closure in
this file).

Comment on lines +1 to +11
<?php

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Sylius\Bundle\CurrencyBundle\Doctrine\ORM\ExchangeRateRepository;

return static function (ContainerConfigurator $container) {
$services = $container->services();
$parameters = $container->parameters();
$parameters->set('sylius.repository.exchange_rate.class', ExchangeRateRepository::class);
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Find service configuration files in the CurrencyBundle and related bundles
fd -t f '\.php$' src/Sylius/Bundle/CurrencyBundle/Resources/config/services --max-results 20

Repository: Sylius/Sylius

Length of output: 213


🏁 Script executed:

# Check a few other service configuration files in Sylius to see the pattern
fd -t f 'services.*\.php$' src/Sylius/Bundle --max-results 15

Repository: Sylius/Sylius

Length of output: 232


🏁 Script executed:

# Look at the specific file and nearby files
head -20 src/Sylius/Bundle/CurrencyBundle/Resources/config/services/integrations/doctrine/orm.php

Repository: Sylius/Sylius

Length of output: 445


🏁 Script executed:

# Check other similar ORM service files to see if they have strict_types
fd -t f 'orm\.php$' --max-results 10

Repository: Sylius/Sylius

Length of output: 213


🏁 Script executed:

# Let's examine what the codebase pattern is for service config files
rg -A 5 'return static function' src/Sylius/Bundle --max-count 5

Repository: Sylius/Sylius

Length of output: 3721


Add strict_types=1 and a void return type for the config closure.

These are required by the PHP guidelines and keep config files consistent.

🔧 Proposed fix
 <?php
+declare(strict_types=1);

 namespace Symfony\Component\DependencyInjection\Loader\Configurator;
 
-return static function (ContainerConfigurator $container) {
+return static function (ContainerConfigurator $container): void {
🤖 Prompt for AI Agents
In
`@src/Sylius/Bundle/CurrencyBundle/Resources/config/services/integrations/doctrine/orm.php`
around lines 1 - 11, Add a strict types declaration and a void return type on
the config closure: at the top of the file add declare(strict_types=1); after
the opening <?php, and change the exported closure signature from "return static
function (ContainerConfigurator $container)" to "return static function
(ContainerConfigurator $container): void" so the file follows PHP guidelines;
update any references to the closure (the returned static function using
ContainerConfigurator) accordingly.

@crydotsnake crydotsnake force-pushed the xml2php/currency branch 3 times, most recently from 6cfb682 to cc5583a Compare January 31, 2026 12:37
use Sylius\Bundle\CurrencyBundle\Doctrine\ORM\ExchangeRateRepository;

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();

Comment on lines +33 to +36
$services->set('sylius.converter.currency', CurrencyConverter::class)
->args([service('sylius.repository.exchange_rate')]);

$services->alias(CurrencyConverterInterface::class, 'sylius.converter.currency');
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.converter.currency', CurrencyConverter::class)
->args([service('sylius.repository.exchange_rate')]);
$services->alias(CurrencyConverterInterface::class, 'sylius.converter.currency');
$services->set('sylius.converter.currency', CurrencyConverter::class)
->args([service('sylius.repository.exchange_rate')]);
$services->alias(CurrencyConverterInterface::class, 'sylius.converter.currency');

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

Comment on lines +38 to +40
$services->set('sylius.converter.currency_name', CurrencyNameConverter::class);

$services->alias(CurrencyNameConverterInterface::class, 'sylius.converter.currency_name');
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.converter.currency_name', CurrencyNameConverter::class);
$services->alias(CurrencyNameConverterInterface::class, 'sylius.converter.currency_name');
$services->set('sylius.converter.currency_name', CurrencyNameConverter::class);
$services->alias(CurrencyNameConverterInterface::class, 'sylius.converter.currency_name');

@TheMilek TheMilek merged commit 0aaaf3b 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