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

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