Code Duplication    Length = 4-4 lines in 2 locations

Field/Field/Collection.php 1 location

@@ 42-45 (lines=4) @@
39
        foreach ($this->fields as $field) {
40
            $value = null;
41
            // if name starts with a underscore, it is a custom field, not mapped to the entity
42
            if (substr($field->getName(), 0, 1) != '_') {
43
                // get raw value from object
44
                $value = $accessor->getValue($this->entity, $field->getName());
45
            }
46
            // if the field required an entity to be rendered, we set it
47
            if ($field instanceof EntityFieldInterface) {
48
                $field->setEntity($this->entity);

Twig/AdminExtension.php 1 location

@@ 174-177 (lines=4) @@
171
            ->getPropertyAccessor();
172
        $value = null;
173
        // if name starts with a underscore, it is a custom field, not mapped to the entity
174
        if (substr($field->getName(), 0, 1) != '_') {
175
            // get raw value from object
176
            $value = $accessor->getValue($entity, $field->getName());
177
        }
178
        if ($field instanceof EntityFieldInterface) {
179
            $field->setEntity($entity);
180
        }