use php config instead of deprecated xml

This commit is contained in:
2026-04-30 18:51:21 +02:00
parent 50a560b6f4
commit b4b78b0ab5
3 changed files with 31 additions and 29 deletions

View File

@@ -0,0 +1,25 @@
<?php
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use ABEL\Bundle\keycloakBearerOnlyAdapterBundle\Security\User\KeycloakBearerUserProvider;
return static function (ContainerConfigurator $configurator): void {
$services = $configurator->services();
$services
->defaults()
->autowire()
->autoconfigure();
$services->load('ABEL\\Bundle\\keycloakBearerOnlyAdapterBundle\\', '../../*')
->exclude('../../{Entity,Migrations,Tests}');
// empty args → will be replaced later
$services->set('abel_keycloak_bearer_only_adapter.keycloak_bearer_user_provider', KeycloakBearerUserProvider::class)
->args([null, null, null, null, null]);
$services->alias(
KeycloakBearerUserProvider::class,
'abel_keycloak_bearer_only_adapter.keycloak_bearer_user_provider'
);
};

View File

@@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services
https://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<!-- Default configuration for services in *this* file -->
<defaults autowire="true" autoconfigure="true"/>
<!-- makes classes available to be used as services -->
<!-- this creates a service per class whose id is the fully-qualified class name -->
<prototype namespace="ABEL\Bundle\keycloakBearerOnlyAdapterBundle\" resource="../../*" exclude="../../{Entity,Migrations,Tests}"/>
<service id="abel_keycloak_bearer_only_adapter.keycloak_bearer_user_provider" class="ABEL\Bundle\keycloakBearerOnlyAdapterBundle\Security\User\KeycloakBearerUserProvider">
<argument/>
<argument/>
<argument/>
<argument/>
<argument/>
</service>
<service id="ABEL\Bundle\keycloakBearerOnlyAdapterBundle\Security\User\KeycloakBearerUserProvider" alias="abel_keycloak_bearer_only_adapter.keycloak_bearer_user_provider" />
</services>
</container>