Code Duplication    Length = 23-23 lines in 2 locations

src/TreeHouse/IoBundle/Import/Feed/Type/DefaultFeedType.php 1 location

@@ 128-150 (lines=23) @@
125
     *
126
     * @return array
127
     */
128
    protected function getMappedFields()
129
    {
130
        $fields = array_diff(
131
            array_unique(
132
                array_merge(
133
                    array_values($this->getEntityFields()),
134
                    array_values($this->getExtraMappedFields()),
135
                    array_values($this->getMapping())
136
                )
137
            ),
138
            $this->getUnmappedFields()
139
        );
140
141
        $fields = new ParameterBag(array_flip($fields));
142
143
        // make sure id is not in it
144
        $fields->remove('id');
145
146
        $transformer = new UnderscoreKeysTransformer();
147
        $transformer->transform($fields);
148
149
        return $fields->keys();
150
    }
151
152
    /**
153
     * Specify fields here that are explicitly not mapped.

src/TreeHouse/IoBundle/Scrape/Parser/Type/AbstractParserType.php 1 location

@@ 411-433 (lines=23) @@
408
     *
409
     * @return array
410
     */
411
    protected function getMappedFields()
412
    {
413
        $fields = array_diff(
414
            array_unique(
415
                array_merge(
416
                    array_values($this->getEntityFields()),
417
                    array_values($this->getExtraMappedFields()),
418
                    array_keys($this->getMapping())
419
                )
420
            ),
421
            $this->getUnmappedFields()
422
        );
423
424
        $fields = new ParameterBag(array_flip($fields));
425
426
        // make sure id is not in it
427
        $fields->remove('id');
428
429
        $transformer = new UnderscoreKeysTransformer();
430
        $transformer->transform($fields);
431
432
        return $fields->keys();
433
    }
434
435
    /**
436
     * Specify fields here that are explicitly not mapped.