Code Duplication    Length = 13-13 lines in 2 locations

lib/Subscriber/Core/MappingSubscriber.php 2 locations

@@ 82-94 (lines=13) @@
79
        $node = $event->getNode();
80
        $accessor = $event->getAccessor();
81
82
        foreach ($metadata->getFieldMappings() as $fieldName => $fieldMapping) {
83
            if (false === $fieldMapping['mapped']) {
84
                continue;
85
            }
86
87
            switch ($fieldMapping['type']) {
88
                case 'reference':
89
                    $this->persistReference($node, $accessor, $fieldName, $locale, $fieldMapping);
90
                    break;
91
                default:
92
                    $this->persistGeneric($node, $accessor, $fieldName, $locale, $fieldMapping);
93
            }
94
        }
95
    }
96
97
    /**
@@ 185-197 (lines=13) @@
182
        $accessor = $event->getAccessor();
183
        $document = $event->getDocument();
184
185
        foreach ($metadata->getFieldMappings() as $fieldName => $fieldMapping) {
186
            if (false === $fieldMapping['mapped']) {
187
                continue;
188
            }
189
190
            switch ($fieldMapping['type']) {
191
                case 'reference':
192
                    $this->hydrateReferenceField($node, $document, $accessor, $fieldName, $locale, $fieldMapping);
193
                    break;
194
                default:
195
                    $this->hydrateGenericField($node, $accessor, $fieldName, $locale, $fieldMapping);
196
            }
197
        }
198
    }
199
200
    /**