Skip to content
Snippets Groups Projects
Commit 0d5fad70 authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

Rename the example config key to "example_config"

The old name "secret_token" implied a bit that it is required for something,
but it was just an example. This new name should make it more clear.
parent c6e79d90
No related branches found
No related tags found
No related merge requests found
Pipeline #105829 passed
......@@ -65,8 +65,8 @@ content:
```yaml
dbp_relay_template:
secret_token: 42
# secret_token: '%env(SECRET_TOKEN)%'
example_config: 42
# example_config: '%env(EXAMPLE_CONFIG)%'
```
The value gets read in `DbpRelayTemplateExtension` and passed when creating the
......
......@@ -15,7 +15,7 @@ class Configuration implements ConfigurationInterface
$treeBuilder->getRootNode()
->children()
->scalarNode('secret_token')
->scalarNode('example_config')
->defaultValue('42')
->end()
->end();
......
......@@ -24,7 +24,7 @@ class DbpRelayTemplateExtension extends ConfigurableExtension
// Inject the config value into the MyCustomService service
$definition = $container->getDefinition('Dbp\Relay\TemplateBundle\Service\MyCustomService');
$definition->addArgument($mergedConfig['secret_token']);
$definition->addArgument($mergedConfig['example_config']);
}
private function extendArrayParameter(ContainerBuilder $container, string $parameter, array $values)
......
......@@ -6,10 +6,10 @@ namespace Dbp\Relay\TemplateBundle\Service;
class MyCustomService
{
private $token;
private $someConfig;
public function __construct(string $token)
public function __construct(string $someConfig)
{
$this->token = $token;
$this->$someConfig = $someConfig;
}
}
......@@ -48,7 +48,7 @@ class Kernel extends BaseKernel
]);
$container->extension('dbp_relay_template', [
'secret_token' => 'secret-test',
'example_config' => 'test-42',
]);
}
}
......@@ -14,7 +14,7 @@ class ExternalApiTest extends WebTestCase
protected function setUp(): void
{
$service = new MyCustomService('secret-test-custom');
$service = new MyCustomService('test-42');
$this->api = new ExternalApi($service);
}
......
  • Bekerle, Patrizio :fire: @6123FE4C3B2C2770 ·
    Owner

    Nice, I just wanted to do that. :grinning:

    By Bekerle, Patrizio on 2021-12-06T16:05:50 (imported from GitLab)

    Edited by Ghost User
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment