Closed RomanApunts closed 4 years ago
This PR breaks builds other than symfony 5.1 https://travis-ci.org/github/karser/KarserRecaptcha3Bundle/builds/725195469 Can you please add a decorator that takes care of compatibility?
use Symfony\Component\DependencyInjection\Loader\Configurator\ReferenceConfigurator;
function getService(string $id): ReferenceConfigurator {
if (function_exists('\Symfony\Component\DependencyInjection\Loader\Configurator\service')) {
// >= sf 5.1 forward compatibility
return \Symfony\Component\DependencyInjection\Loader\Configurator\service($id);
}
return \Symfony\Component\DependencyInjection\Loader\Configurator\ref($id);
}
I am not sure how to apply the modifications that you indicate, if you would be so kind as to explain the steps to follow, because i see the changes a made break another time but now in all versions of Symfony.
the error is Cannot redeclare getService()
. Can you please try another name? getServiceOrRef
or something like that
Weird. I'll take a look at this.
The previous error was because of services.php was injected multiple times.
I removed the getService
function because service/ref are one-liners. So I inlined their content for now. Tests pass.
@RomanApunts thank you for your PR!
Changes to config file to resolve deprecated function use "ref".
27