mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
[PromotionBundle] Unification of service names
This commit is contained in:
parent
60fb71da6e
commit
f0402e6ea1
5 changed files with 10 additions and 26 deletions
|
|
@ -296,20 +296,6 @@
|
|||
<tag name="form.type" />
|
||||
</service>
|
||||
|
||||
<service id="sylius.form.type.catalog_promotion_action" class="Sylius\Bundle\PromotionBundle\Form\Type\CatalogPromotionActionType">
|
||||
<argument>%sylius.model.catalog_promotion_action.class%</argument>
|
||||
<argument>%sylius.form.type.catalog_promotion.validation_groups%</argument>
|
||||
<argument type="tagged_iterator" tag="sylius.catalog_promotion.action_configuration_type" index-by="key" />
|
||||
<tag name="form.type" />
|
||||
</service>
|
||||
|
||||
<service id="sylius.form.type.catalog_promotion_scope" class="Sylius\Bundle\PromotionBundle\Form\Type\CatalogPromotionScopeType">
|
||||
<argument>%sylius.model.catalog_promotion_scope.class%</argument>
|
||||
<argument>%sylius.form.type.catalog_promotion.validation_groups%</argument>
|
||||
<argument type="tagged_iterator" tag="sylius.catalog_promotion.scope_configuration_type" index-by="key" />
|
||||
<tag name="form.type" />
|
||||
</service>
|
||||
|
||||
<service id="sylius.form.type.channel_price_history_config" class="Sylius\Bundle\CoreBundle\Form\Type\ChannelPriceHistoryConfigType">
|
||||
<argument type="service">
|
||||
<service class="\Symfony\Component\Form\Extension\Core\DataMapper\DataMapper" />
|
||||
|
|
|
|||
|
|
@ -21,11 +21,11 @@ final class RegisterPromotionActionsPass implements CompilerPassInterface
|
|||
{
|
||||
public function process(ContainerBuilder $container): void
|
||||
{
|
||||
if (!$container->has('sylius.registry.promotion.action') || !$container->has('sylius.form_registry.promotion_action')) {
|
||||
if (!$container->has('sylius.registry.promotion_action') || !$container->has('sylius.form_registry.promotion_action')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$promotionActionRegistry = $container->getDefinition('sylius.registry.promotion.action');
|
||||
$promotionActionRegistry = $container->getDefinition('sylius.registry.promotion_action');
|
||||
$promotionActionFormTypeRegistry = $container->getDefinition('sylius.form_registry.promotion_action');
|
||||
|
||||
$promotionActionTypeToLabelMap = [];
|
||||
|
|
|
|||
|
|
@ -50,11 +50,10 @@
|
|||
|
||||
<service id="sylius.form_registry.promotion_rule_checker" class="Sylius\Bundle\ResourceBundle\Form\Registry\FormTypeRegistry" />
|
||||
|
||||
<service id="sylius.registry.promotion.action" class="Sylius\Component\Registry\ServiceRegistry">
|
||||
<service id="sylius.registry.promotion_action" class="Sylius\Component\Registry\ServiceRegistry">
|
||||
<argument>Sylius\Component\Promotion\Action\PromotionActionCommandInterface</argument>
|
||||
<argument>promotion action</argument>
|
||||
</service>
|
||||
<service id="sylius.registry.promotion_action" alias="sylius.registry.promotion.action" />
|
||||
|
||||
<service id="sylius.form_registry.promotion_action" class="Sylius\Bundle\ResourceBundle\Form\Registry\FormTypeRegistry" />
|
||||
|
||||
|
|
|
|||
|
|
@ -56,17 +56,16 @@
|
|||
<service id="sylius.form.type.catalog_promotion_scope" class="Sylius\Bundle\PromotionBundle\Form\Type\CatalogPromotionScopeType">
|
||||
<argument>%sylius.model.catalog_promotion_scope.class%</argument>
|
||||
<argument>%sylius.form.type.catalog_promotion.validation_groups%</argument>
|
||||
<argument type="collection"/>
|
||||
<argument type="tagged_iterator" tag="sylius.catalog_promotion.scope_configuration_type" index-by="key" />
|
||||
<tag name="form.type" />
|
||||
</service>
|
||||
|
||||
<service id="Sylius\Bundle\PromotionBundle\Form\Type\CatalogPromotionActionType">
|
||||
<service id="sylius.form.type.catalog_promotion_action" class="Sylius\Bundle\PromotionBundle\Form\Type\CatalogPromotionActionType">
|
||||
<argument>%sylius.model.catalog_promotion_action.class%</argument>
|
||||
<argument>%sylius.form.type.catalog_promotion.validation_groups%</argument>
|
||||
<argument type="tagged_iterator" tag="sylius.catalog_promotion.action_configuration_type" index-by="key" />
|
||||
<tag name="form.type" />
|
||||
</service>
|
||||
<service id="sylius.form.type.catalog_promotion_action" alias="Sylius\Bundle\PromotionBundle\Form\Type\CatalogPromotionActionType" />
|
||||
|
||||
<service id="sylius.form.type.catalog_promotion_translation" class="Sylius\Bundle\PromotionBundle\Form\Type\CatalogPromotionTranslationType">
|
||||
<argument>%sylius.model.catalog_promotion_translation.class%</argument>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ final class RegisterPromotionActionsPassTest extends AbstractCompilerPassTestCas
|
|||
*/
|
||||
public function it_registers_collected_promotion_actions_in_the_registry(): void
|
||||
{
|
||||
$this->setDefinition('sylius.registry.promotion.action', new Definition());
|
||||
$this->setDefinition('sylius.registry.promotion_action', new Definition());
|
||||
$this->setDefinition('sylius.form_registry.promotion_action', new Definition());
|
||||
$this->setDefinition(
|
||||
'action',
|
||||
|
|
@ -38,12 +38,12 @@ final class RegisterPromotionActionsPassTest extends AbstractCompilerPassTestCas
|
|||
$this->compile();
|
||||
|
||||
$this->assertContainerBuilderHasServiceDefinitionWithMethodCall(
|
||||
'sylius.registry.promotion.action',
|
||||
'sylius.registry.promotion_action',
|
||||
'register',
|
||||
['custom', new Reference('action')],
|
||||
);
|
||||
$this->assertContainerBuilderHasServiceDefinitionWithMethodCall(
|
||||
'sylius.registry.promotion.action',
|
||||
'sylius.registry.promotion_action',
|
||||
'register',
|
||||
['another_custom', new Reference('action')],
|
||||
);
|
||||
|
|
@ -54,7 +54,7 @@ final class RegisterPromotionActionsPassTest extends AbstractCompilerPassTestCas
|
|||
*/
|
||||
public function it_creates_parameter_which_maps_promotion_action_type_to_label(): void
|
||||
{
|
||||
$this->setDefinition('sylius.registry.promotion.action', new Definition());
|
||||
$this->setDefinition('sylius.registry.promotion_action', new Definition());
|
||||
$this->setDefinition('sylius.form_registry.promotion_action', new Definition());
|
||||
$this->setDefinition(
|
||||
'action',
|
||||
|
|
@ -76,7 +76,7 @@ final class RegisterPromotionActionsPassTest extends AbstractCompilerPassTestCas
|
|||
*/
|
||||
public function it_registers_collected_promotion_actions_form_types_in_the_registry(): void
|
||||
{
|
||||
$this->setDefinition('sylius.registry.promotion.action', new Definition());
|
||||
$this->setDefinition('sylius.registry.promotion_action', new Definition());
|
||||
$this->setDefinition('sylius.form_registry.promotion_action', new Definition());
|
||||
$this->setDefinition(
|
||||
'action',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue