Skip to content

Commit

Permalink
no issue - fix configuration regression when 'connections' is being u…
Browse files Browse the repository at this point in the history
…sed as a string
  • Loading branch information
pounard committed Nov 21, 2024
1 parent 101205e commit 782cc63
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion docs/content/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ Then, copy the default configuration file from the vendor directory:
```sh
cd your_project_dir
cp vendor/makinacorpus/db-tools-bundle/config/db_tools.standalone.sample.yaml db_tools.config.yaml
cp config/anonymizations.sample.yaml db_tools.anonymization.yaml
```

Update these files to your needs. The only required parameter is `connections` in which you
Expand Down
12 changes: 7 additions & 5 deletions src/Bridge/Symfony/DependencyInjection/DbToolsConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,16 @@ public function getConfigTreeBuilder(): TreeBuilder
$connectionsNode = $rootNode
->children()
->arrayNode('connections')
->beforeNormalization()->ifString()->then(function ($v) { return ['default' => $v]; })->end()
->useAttributeAsKey('name')
->arrayPrototype()
->children()
->scalarNode('url')
->defaultNull()
->beforeNormalization()->ifString()->then(function ($v) { return ['url' => $v]; })->end()
->children()
->scalarNode('url')
->defaultNull()
->end()
->end()
->end()
// Do not close arrayNode() we use it below.
// Do not close arrayNode() we use it below.
;
\assert($connectionsNode instanceof ArrayNodeDefinition);
$this->addConnectionConfigTreeBuilder($connectionsNode);
Expand Down

0 comments on commit 782cc63

Please sign in to comment.