Code Duplication    Length = 4-4 lines in 2 locations

src/Field/CollectionField.php 1 location

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

src/Bridge/Twig/Extension/AdminExtension.php 1 location

@@ 221-224 (lines=4) @@
218
        $accessor = PropertyAccess::createPropertyAccessor();
219
220
        // if name starts with a underscore, it is a custom field, not mapped to the entity
221
        if (substr($field->getName(), 0, 1) !== '_') {
222
            // get raw value from object
223
            $value = $accessor->getValue($entity, $field->getName());
224
        }
225
226
        if ($field instanceof EntityAwareFieldInterface) {
227
            $field->setEntity($entity);