Skip to content

Commit

Permalink
Minimum version of Symfony is ^5.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jun 25, 2020
1 parent 046a332 commit 57ec345
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 17 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
"ext-simplexml": "*",
"ecphp/cas-bundle": "^2",
"ecphp/ecas": "^2",
"symfony/framework-bundle": "^5"
"symfony/framework-bundle": "^5.1"
},
"require-dev": {
"drupol/php-conventions": "^1.7.1",
"friends-of-phpspec/phpspec-code-coverage": "^4.3.2",
"infection/infection": "^0.15.3 || ^0.16.3",
"infection/phpspec-adapter": "^0.1.1",
"phpspec/phpspec": "^6.2"
},
"autoload": {
Expand Down
6 changes: 3 additions & 3 deletions src/DependencyInjection/EuLoginExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;

/**
Expand All @@ -21,7 +21,7 @@ class EuLoginExtension extends Extension
public function load(array $configs, ContainerBuilder $container): void
{
// Load EU Login services.
$loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('services.yaml');
$loader = new PhpFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('services.php');
}
}
33 changes: 33 additions & 0 deletions src/Resources/config/services.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

declare(strict_types=1);

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use EcPhp\Ecas\Ecas;
use EcPhp\Ecas\EcasProperties;
use EcPhp\EuLoginBundle\Security\Core\User\EuLoginUserProvider;

return static function (ContainerConfigurator $container) {
$container
->services()
->set('eulogin.userprovider', EuLoginUserProvider::class);

$container
->services()
->set('ecas.configuration', EcasProperties::class)
->decorate('cas.configuration')
->args([
service('ecas.configuration.inner'),
service('request_stack'),
]);

$container
->services()
->set('ecas', Ecas::class)
->decorate('cas')
->args([
service('cas.inner'),
service('nyholm.psr7.psr17_factory'),
]);
};
13 changes: 0 additions & 13 deletions src/Resources/config/services.yaml

This file was deleted.

0 comments on commit 57ec345

Please sign in to comment.