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 a82c332
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 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 DEPRECATED_FIELD_TYPE_FORM_MAPPER_VALUE_SERVICE_TAG = 'ez.fieldFormMapper.value';
public const DEPRECATED_FIELD_TYPE_FORM_MAPPER_DEFINITION_SERVICE_TAG = 'ez.fieldFormMapper.definition';
public const FIELD_TYPE_FORM_MAPPER_VALUE_SERVICE_TAG = 'ezplatform.field_type.form_mapper.value';
public const FIELD_TYPE_FORM_MAPPER_DEFINITION_SERVICE_TAG = 'ezplatform.field_type.form_mapper.definition';

public function process(ContainerBuilder $container)
{
Expand Down Expand Up @@ -58,38 +58,38 @@ 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);
$deprecatedFieldFormMapperValueTags = $container->findTaggedServiceIds(self::DEPRECATED_FIELD_TYPE_FORM_MAPPER_VALUE_SERVICE_TAG);
$deprecatedFieldFormMapperDefinitionTags = $container->findTaggedServiceIds(self::DEPRECATED_FIELD_TYPE_FORM_MAPPER_DEFINITION_SERVICE_TAG);
$fieldFormMapperValueTags = $container->findTaggedServiceIds(self::FIELD_TYPE_FORM_MAPPER_VALUE_SERVICE_TAG);
$fieldFormMapperDefinitionTags = $container->findTaggedServiceIds(self::FIELD_TYPE_FORM_MAPPER_DEFINITION_SERVICE_TAG);

foreach ($ezFieldFormMapperValueTags as $ezFieldFormMapperValueTag) {
foreach ($deprecatedFieldFormMapperValueTags 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::DEPRECATED_FIELD_TYPE_FORM_MAPPER_VALUE_SERVICE_TAG,
self::FIELD_TYPE_FORM_MAPPER_VALUE_SERVICE_TAG
),
E_USER_DEPRECATED
);
}

foreach ($ezFieldFormMapperDefinitionTags as $ezFieldFormMapperValueTag) {
foreach ($deprecatedFieldFormMapperDefinitionTags 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_DEFINITION,
self::EZPLATFORM_FIELD_TYPE_FORM_MAPPER_DEFINITION
self::DEPRECATED_FIELD_TYPE_FORM_MAPPER_DEFINITION_SERVICE_TAG,
self::FIELD_TYPE_FORM_MAPPER_DEFINITION_SERVICE_TAG
),
E_USER_DEPRECATED
);
}

return array_merge(
$ezFieldFormMapperValueTags,
$ezFieldFormMapperDefinitionTags,
$ezplatformFieldFormMapperValueTags,
$ezplatformFieldFormMapperDefinitionTags
$deprecatedFieldFormMapperValueTags,
$deprecatedFieldFormMapperDefinitionTags,
$fieldFormMapperValueTags,
$fieldFormMapperDefinitionTags
);
}
}
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::DEPRECATED_FIELD_TYPE_FORM_MAPPER_VALUE_SERVICE_TAG],
[FieldTypeFormMapperDispatcherPass::DEPRECATED_FIELD_TYPE_FORM_MAPPER_DEFINITION_SERVICE_TAG],
[FieldTypeFormMapperDispatcherPass::FIELD_TYPE_FORM_MAPPER_VALUE_SERVICE_TAG],
[FieldTypeFormMapperDispatcherPass::FIELD_TYPE_FORM_MAPPER_DEFINITION_SERVICE_TAG],
];
}
}

0 comments on commit a82c332

Please sign in to comment.