Skip to content

Conversation

@AAYUSH-SPIDEY-SHARMA
Copy link

Summary

This PR migrates the bundle DependencyInjection configuration away from XML (deprecated in Symfony 7.4) to a modern PHP services.php file.

Changes

  • Replaced XmlFileLoader with PhpFileLoader in BeelabRecaptcha2Extension.
  • Added new config/services.php with all service definitions:
    • beelab_recaptcha2.google_recaptcha service with constructor arguments.
    • recaptcha2 validator service (tagged as validator.constraint_validator).
    • RecaptchaType form type service (tagged as form.type).
  • Ensured compatibility with existing compiler pass (RequestMethodPass) by preserving service IDs and argument positions.

Why

  • Symfony 7.4 deprecates XML DI configuration format (XmlFileLoader).
  • Migrating to PHP removes deprecations, improves performance, and future-proofs the bundle.
  • Fixes Migrate configuration to YAML or PHP #66.

Testing

  • Ran PHPUnit test suite locally: ✅ all tests passed.
  • Verified deprecation notices: ✅ none remaining on Symfony 7.4.
  • CI workflow matrix updated to include Symfony 7.4 (optional, if added).

Notes

  • Service IDs and tags preserved for backward compatibility.
  • Compiler passes (RequestMethodPass, TwigFormPass) continue to function as expected.

@garak
Copy link
Member

garak commented Oct 2, 2025

Please apply the changes suggested by StyleCI

@garak garak added the hacktoberfest-accepted See https://hacktoberfest.com label Oct 9, 2025
Copy link
Member

@garak garak left a comment

Choose a reason for hiding this comment

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

An update in .php-cs-fixer.php is needed to take into account the config path

$services = $configurator->services();

// sensible defaults
$services->defaults()
Copy link
Member

Choose a reason for hiding this comment

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

This part should not be here, please remove

$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../../config'));
$loader->load('services.xml');
$loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../../config'));
$loader->load('services.php');
Copy link
Member

Choose a reason for hiding this comment

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

the xml file needs to be removed

@garak
Copy link
Member

garak commented Oct 28, 2025

Gentle bump.

@garak
Copy link
Member

garak commented Nov 7, 2025

Please take action; otherwise, I'll be forced to close this due to missing feedback.

@garak garak closed this Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted See https://hacktoberfest.com

Development

Successfully merging this pull request may close these issues.

Migrate configuration to YAML or PHP

2 participants