Code Duplication    Length = 8-8 lines in 2 locations

src/Knp/FriendlyContexts/Context/AliceContext.php 1 location

@@ 73-80 (lines=8) @@
70
        foreach ($loader->getCache() as $cache) {
71
            list($values, $entity) = $cache;
72
            $reflection = new \ReflectionClass($entity);
73
            do {
74
                $this
75
                    ->getRecordBag()
76
                    ->getCollection($reflection->getName())
77
                    ->attach($entity, $values)
78
                ;
79
                $reflection = $reflection->getParentClass();
80
            } while (false !== $reflection);
81
        }
82
        $loader->clearCache();
83
    }

src/Knp/FriendlyContexts/Context/EntityContext.php 1 location

@@ 30-37 (lines=8) @@
27
            $entity     = new $entityName;
28
            $reflection = new \ReflectionClass($entity);
29
30
            do {
31
                $this
32
                    ->getRecordBag()
33
                    ->getCollection($reflection->getName())
34
                    ->attach($entity, $values)
35
                ;
36
                $reflection = $reflection->getParentClass();
37
            } while (false !== $reflection);
38
39
            $this
40
                ->getEntityHydrator()