diff --git a/src/Bundle/ChillWopiBundle/src/Controller/Test.php b/src/Bundle/ChillWopiBundle/src/Controller/Test.php index d0a45e9a0..ed7cf9c00 100644 --- a/src/Bundle/ChillWopiBundle/src/Controller/Test.php +++ b/src/Bundle/ChillWopiBundle/src/Controller/Test.php @@ -10,24 +10,20 @@ declare(strict_types=1); namespace Chill\WopiBundle\Controller; use Chill\WopiBundle\Service\OpenStack\OpenStackClientInterface; -use OpenStack\OpenStack; use Symfony\Component\HttpFoundation\Response; final class Test { private OpenStackClientInterface $client; - private OpenStack $osClient; - - public function __construct(OpenStackClientInterface $client, OpenStack $osClient) + public function __construct(OpenStackClientInterface $client) { $this->client = $client; - $this->osClient = $osClient; } public function __invoke() { - dump($this->osClient); + dump($this->client); return new Response('fobar'); } diff --git a/src/Bundle/ChillWopiBundle/src/DependencyInjection/ChillWopiExtension.php b/src/Bundle/ChillWopiBundle/src/DependencyInjection/ChillWopiExtension.php index bb6171056..d67a62d94 100644 --- a/src/Bundle/ChillWopiBundle/src/DependencyInjection/ChillWopiExtension.php +++ b/src/Bundle/ChillWopiBundle/src/DependencyInjection/ChillWopiExtension.php @@ -23,17 +23,7 @@ final class ChillWopiExtension extends Extension $container ->setParameter( 'chill_wopi', - $this->processConfiguration(new Configuration(), $configs) - ); - - - var_dump($config); - - - $container - ->setParameter( - 'chill_wopi.openstack_client', - $config['openstack'] + $config ); $loader = new PhpFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); diff --git a/src/Bundle/ChillWopiBundle/src/Resources/config/services.php b/src/Bundle/ChillWopiBundle/src/Resources/config/services.php index 58286d66c..98cd4f002 100644 --- a/src/Bundle/ChillWopiBundle/src/Resources/config/services.php +++ b/src/Bundle/ChillWopiBundle/src/Resources/config/services.php @@ -21,14 +21,9 @@ return static function (ContainerConfigurator $container) { ->autoconfigure(); $services - ->load('ChampsLibres\\WopiTestBundle\\Service\\', __DIR__ . '/../../Service'); + ->load('Chill\\WopiBundle\\Service\\', __DIR__ . '/../../Service'); $services ->load('Chill\\WopiBundle\\Controller\\', __DIR__ . '/../../Controller') ->tag('controller.service_arguments'); - - $services - ->set('chill_wopi.openstack_client') - ->class(OpenStack::class) - ->arg('$options', '%chill_wopi.openstack_client%'); }; diff --git a/src/Bundle/ChillWopiBundle/src/Service/OpenStack/Client.php b/src/Bundle/ChillWopiBundle/src/Service/OpenStack/Client.php index 085e99d82..29cda11dd 100644 --- a/src/Bundle/ChillWopiBundle/src/Service/OpenStack/Client.php +++ b/src/Bundle/ChillWopiBundle/src/Service/OpenStack/Client.php @@ -1,10 +1,20 @@ get('chill_wopi'); + + parent::__construct($configuration['openstack']); + } } diff --git a/src/Bundle/ChillWopiBundle/src/Service/OpenStack/OpenStackClientInterface.php b/src/Bundle/ChillWopiBundle/src/Service/OpenStack/OpenStackClientInterface.php index d8b2cfaee..3662b76eb 100644 --- a/src/Bundle/ChillWopiBundle/src/Service/OpenStack/OpenStackClientInterface.php +++ b/src/Bundle/ChillWopiBundle/src/Service/OpenStack/OpenStackClientInterface.php @@ -1,5 +1,7 @@