Skip to content

Commit

Permalink
EZP-30462: Configure Field Type features with tags which follows same…
Browse files Browse the repository at this point in the history
… convention - cr
  • Loading branch information
mikadamczyk committed Jun 7, 2019
1 parent 9a1d50a commit 8e1f247
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
class FieldTypeFormMapperDispatcherPass implements CompilerPassInterface
{
public const FIELD_TYPE_FORM_MAPPER_DISPATCHER = 'ezrepoforms.field_type_form_mapper.dispatcher';
public const FIELD_FORM_MAPPER_VALUE = 'ez.fieldFormMapper.value';
public const FIELD_FORM_MAPPER_DEFINITION = 'ez.fieldFormMapper.definition';
public const EZPLATFORM_FIELD_TYPE_FORM_MAPPER_VALUE = 'ezplatform.field_type.form_mapper.value';
public const EZPLATFORM_FIELD_TYPE_FORM_MAPPER_DEFINITION = 'ezplatform.field_type.form_mapper.definition';
public const FIELD_TYPE_FORM_MAPPER_VALUE_SERVICE_TAG = 'ez.fieldFormMapper.value';
public const FIELD_TYPE_FORM_MAPPER_DEFINITION_SERVICE_TAG = 'ez.fieldFormMapper.definition';
public const DEPRECATED_FIELD_TYPE_FORM_MAPPER_VALUE_SERVICE_TAG = 'ezplatform.field_type.form_mapper.value';
public const DEPRECATED_FIELD_TYPE_FORM_MAPPER_DEFINITION_SERVICE_TAG = 'ezplatform.field_type.form_mapper.definition';

public function process(ContainerBuilder $container)
{
Expand Down Expand Up @@ -58,17 +58,17 @@ public function process(ContainerBuilder $container)
*/
private function findTaggedFormMapperServices(ContainerBuilder $container): array
{
$ezFieldFormMapperValueTags = $container->findTaggedServiceIds(self::FIELD_FORM_MAPPER_VALUE);
$ezFieldFormMapperDefinitionTags = $container->findTaggedServiceIds(self::FIELD_FORM_MAPPER_DEFINITION);
$ezplatformFieldFormMapperValueTags = $container->findTaggedServiceIds(self::EZPLATFORM_FIELD_TYPE_FORM_MAPPER_VALUE);
$ezplatformFieldFormMapperDefinitionTags = $container->findTaggedServiceIds(self::EZPLATFORM_FIELD_TYPE_FORM_MAPPER_DEFINITION);
$ezFieldFormMapperValueTags = $container->findTaggedServiceIds(self::FIELD_TYPE_FORM_MAPPER_VALUE_SERVICE_TAG);
$ezFieldFormMapperDefinitionTags = $container->findTaggedServiceIds(self::FIELD_TYPE_FORM_MAPPER_DEFINITION_SERVICE_TAG);
$ezplatformFieldFormMapperValueTags = $container->findTaggedServiceIds(self::DEPRECATED_FIELD_TYPE_FORM_MAPPER_VALUE_SERVICE_TAG);
$ezplatformFieldFormMapperDefinitionTags = $container->findTaggedServiceIds(self::DEPRECATED_FIELD_TYPE_FORM_MAPPER_DEFINITION_SERVICE_TAG);

foreach ($ezFieldFormMapperValueTags as $ezFieldFormMapperValueTag) {
@trigger_error(
sprintf(
'`%s` service tag is deprecated and will be removed in eZ Platform 4.0. Please use `%s` instead.',
self::FIELD_FORM_MAPPER_VALUE,
self::EZPLATFORM_FIELD_TYPE_FORM_MAPPER_VALUE
self::FIELD_TYPE_FORM_MAPPER_VALUE_SERVICE_TAG,
self::DEPRECATED_FIELD_TYPE_FORM_MAPPER_VALUE_SERVICE_TAG
),
E_USER_DEPRECATED
);
Expand All @@ -78,8 +78,8 @@ private function findTaggedFormMapperServices(ContainerBuilder $container): arra
@trigger_error(
sprintf(
'`%s` service tag is deprecated and will be removed in eZ Platform 4.0. Please use `%s` instead.',
self::FIELD_FORM_MAPPER_DEFINITION,
self::EZPLATFORM_FIELD_TYPE_FORM_MAPPER_DEFINITION
self::FIELD_TYPE_FORM_MAPPER_DEFINITION_SERVICE_TAG,
self::DEPRECATED_FIELD_TYPE_FORM_MAPPER_DEFINITION_SERVICE_TAG
),
E_USER_DEPRECATED
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ public function testRegisterMappers(string $tag)
public function tagsProvider(): array
{
return [
[FieldTypeFormMapperDispatcherPass::FIELD_FORM_MAPPER_VALUE],
[FieldTypeFormMapperDispatcherPass::FIELD_FORM_MAPPER_DEFINITION],
[FieldTypeFormMapperDispatcherPass::EZPLATFORM_FIELD_TYPE_FORM_MAPPER_VALUE],
[FieldTypeFormMapperDispatcherPass::EZPLATFORM_FIELD_TYPE_FORM_MAPPER_DEFINITION],
[FieldTypeFormMapperDispatcherPass::FIELD_TYPE_FORM_MAPPER_VALUE_SERVICE_TAG],
[FieldTypeFormMapperDispatcherPass::FIELD_TYPE_FORM_MAPPER_DEFINITION_SERVICE_TAG],
[FieldTypeFormMapperDispatcherPass::DEPRECATED_FIELD_TYPE_FORM_MAPPER_VALUE_SERVICE_TAG],
[FieldTypeFormMapperDispatcherPass::DEPRECATED_FIELD_TYPE_FORM_MAPPER_DEFINITION_SERVICE_TAG],
];
}
}

0 comments on commit 8e1f247

Please sign in to comment.