From fc89d09aef1fe6a93d80f7f64baed3fdaad89f0c Mon Sep 17 00:00:00 2001 From: webeweb Date: Thu, 10 Oct 2019 19:26:32 +0200 Subject: [PATCH] Update sMsmode extension --- CHANGELOG.md | 4 ++++ DependencyInjection/WBWSMSModeExtension.php | 21 +++++++++------------ composer.json | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3b781b..b12dce6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ CHANGELOG ========= +### [1.4.0](https://github.com/webeweb/smsmode-bundle/tree/v1.4.0) (2019-10-10) + +- Update sMsmode extension + ### [1.3.0](https://github.com/webeweb/smsmode-bundle/tree/v1.3.0) (2019-08-08) - Improve logs diff --git a/DependencyInjection/WBWSMSModeExtension.php b/DependencyInjection/WBWSMSModeExtension.php index 17534ce..462e999 100644 --- a/DependencyInjection/WBWSMSModeExtension.php +++ b/DependencyInjection/WBWSMSModeExtension.php @@ -16,6 +16,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\Extension; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; +use WBW\Bundle\CoreBundle\DependencyInjection\ConfigurationHelper; /** * sMsmode extension. @@ -54,20 +55,16 @@ public function load(array $configs, ContainerBuilder $container) { $config = $this->processConfiguration($configuration, $configs); - if (true === array_key_exists("authentication", $config)) { - if (true === array_key_exists("access_token", $config["authentication"])) { - $container->setParameter("smsmode.access_token", $config["authentication"]["access_token"]); - } - if (true === array_key_exists("pseudo", $config["authentication"])) { - $container->setParameter("smsmode.pseudo", $config["authentication"]["pseudo"]); - } - if (true === array_key_exists("pass", $config["authentication"])) { - $container->setParameter("smsmode.pass", $config["authentication"]["pass"]); - } - } - if (true === $config["event_listeners"]) { $serviceLoader->load("event_listeners.yml"); } + + if (true === array_key_exists("authentication", $config)) { + ConfigurationHelper::registerContainerParameter($container, $config["authentication"], "smsmode", "access_token"); + ConfigurationHelper::registerContainerParameter($container, $config["authentication"], "smsmode", "pseudo"); + ConfigurationHelper::registerContainerParameter($container, $config["authentication"], "smsmode", "pass"); + } + + ConfigurationHelper::registerContainerParameter($container, $config, $this->getAlias(), "event_listeners"); } } diff --git a/composer.json b/composer.json index 6009289..0e57db3 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "require": { "php": "^5.6|^7.0", "ext-json": "*", - "webeweb/core-bundle": "^2.9", + "webeweb/core-bundle": "^2.13", "webeweb/smsmode-library": "^2.5" }, "require-dev": {