Skip to content

Commit

Permalink
Merge pull request #38 from BitBagCommerce/dependency_injection_param…
Browse files Browse the repository at this point in the history
…eter

move parameters setup to di
  • Loading branch information
czechmarcin authored Nov 2, 2020
2 parents 1fd574d + 22b0ea7 commit ac9e5c5
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ $ bin/console debug:container | grep bitbag_sylius_wishlist_plugin
### Parameters you can override in your parameters.yml(.dist) file
```yml
$ bin/console debug:container --parameters | grep bitbag
$ bin/console debug:container --parameters | grep wishlist
```

## Testing
Expand Down
1 change: 1 addition & 0 deletions src/DependencyInjection/BitBagSyliusWishlistExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public function load(array $config, ContainerBuilder $container): void
$loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$this->registerResources('bitbag_sylius_wishlist_plugin', 'doctrine/orm', $config['resources'], $container);
$loader->load('services.yml');
$container->setParameter('wishlist_cookie_token', $config['wishlist_cookie_token']);
}

public function prepend(ContainerBuilder $container): void
Expand Down
4 changes: 4 additions & 0 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ public function getConfigTreeBuilder(): TreeBuilder
$rootNode = $treeBuilder->getRootNode();
$rootNode
->children()
->scalarNode('wishlist_cookie_token')
->defaultValue('wishlist_cookie_token')
->cannotBeEmpty()
->end()
->arrayNode('resources')
->addDefaultsIfNotSet()
->children()
Expand Down
3 changes: 0 additions & 3 deletions src/Resources/config/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
parameters:
wishlist_cookie_token: bitbag_sylius_wishlist

imports:
- { resource: "@BitBagSyliusWishlistPlugin/Resources/config/services.yml" }
- { resource: "@BitBagSyliusWishlistPlugin/Resources/config/resources.yml" }
3 changes: 0 additions & 3 deletions tests/Application/config/packages/_sylius.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
imports:
- { resource: "@SyliusCoreBundle/Resources/config/app/config.yml" }

- { resource: "@SyliusAdminBundle/Resources/config/app/config.yml" }
- { resource: "@SyliusAdminApiBundle/Resources/config/app/config.yml" }

- { resource: "@SyliusShopBundle/Resources/config/app/config.yml" }

- { resource: "@SyliusApiBundle/Resources/config/app/config.yaml" }

parameters:
Expand Down

0 comments on commit ac9e5c5

Please sign in to comment.