Code Duplication    Length = 3-4 lines in 2 locations

Doctrine/AbstractElasticaToModelTransformer.php 1 location

@@ 102-105 (lines=4) @@
99
100
        // sort objects in the order of ids
101
        $idPos = array_flip($ids);
102
        usort($objects, function($a, $b) use ($idPos, $identifier, $propertyAccessor)
103
        {
104
            return $idPos[$propertyAccessor->getValue($a, $identifier)] > $idPos[$propertyAccessor->getValue($b, $identifier)];
105
        });
106
107
        return $objects;
108
    }

Transformer/AbstractElasticaToModelTransformer.php 1 location

@@ 47-49 (lines=3) @@
44
    {
45
        $propertyAccessor = $this->propertyAccessor;
46
47
        return function ($a, $b) use ($idPos, $identifierPath, $propertyAccessor) {
48
            return $idPos[$propertyAccessor->getValue($a, $identifierPath)] > $idPos[$propertyAccessor->getValue($b, $identifierPath)];
49
        };
50
    }
51
}
52