Code Duplication    Length = 10-14 lines in 2 locations

src/Mapping/DenormalizationFieldMappingBuilder.php 2 locations

@@ 59-72 (lines=14) @@
56
     *
57
     * @return DenormalizationFieldMappingBuilderInterface
58
     */
59
    public static function create(
60
        string $name,
61
        bool $emptyToNull = false,
62
        FieldDenormalizerInterface $fieldDenormalizer = null
63
    ): DenormalizationFieldMappingBuilderInterface {
64
        if (null === $fieldDenormalizer) {
65
            $fieldDenormalizer = new FieldDenormalizer(new PropertyAccessor($name), $emptyToNull);
66
        }
67
68
        $self = new self($name);
69
        $self->fieldDenormalizer = $fieldDenormalizer;
70
71
        return $self;
72
    }
73
74
    /**
75
     * @param string   $name
@@ 113-122 (lines=10) @@
110
     *
111
     * @return DenormalizationFieldMappingBuilderInterface
112
     */
113
    public static function createDateTime(
114
        string $name,
115
        bool $emptyToNull = false,
116
        \DateTimeZone $dateTimeZone = null
117
    ): DenormalizationFieldMappingBuilderInterface {
118
        $self = new self($name);
119
        $self->fieldDenormalizer = new DateTimeFieldDenormalizer(new PropertyAccessor($name), $emptyToNull, $dateTimeZone);
120
121
        return $self;
122
    }
123
124
    /**
125
     * @param string $name