src/Graviton/DocumentBundle/DependencyInjection/Compiler/Utils/DocumentMap.php
private function loadSerializerClassMap(Finder $finder)
    {
        $classMap = [];
        foreach ($finder as $file) {
            $document = new \DOMDocument();
            $document->load($file);

            $xpath = new \DOMXPath($document);

            $classMap = array_reduce(
                iterator_to_array($xpath->query('//class')),
                function (array $classMap, \DOMElement $element) {
                    $classMap[$element->getAttribute('name')] = $element;
                    return $classMap;
                },
                $classMap
            );
        }

        return $classMap;
    }
private function loadSerializerClassMap(Finder $finder)
    {
        $classMap = [];
        foreach ($finder as $file) {
            $document = new \DOMDocument();
            $document->load($file);

            $xpath = new \DOMXPath($document);

            $classMap = array_reduce(
                iterator_to_array($xpath->query('//class')),
                function (array $classMap, \DOMElement $element) {
                    $classMap[$element->getAttribute('name')] = $element;
                    return $classMap;
                },
                $classMap
            );
        }

        return $classMap;
    }
private function loadSerializerClassMap ( Finder $ finder ) { $ classMap = [ ] ; foreach ( $ finder as $ file ) { $ document = new \ DOMDocument ( ) ; $ document -> load ( $ file ) ; $ xpath = new \ DOMXPath ( $ document ) ; $ classMap = array_reduce ( iterator_to_array ( $ xpath -> query ( '//class' ) ) , function ( array $ classMap , \ DOMElement $ element ) { $ classMap [ $ element -> getAttribute ( 'name' ) ] = $ element ; return $ classMap ; } , $ classMap ) ; } return $ classMap ; }
Load serializer class map

@param Finder $finder Mapping finder
@return array
Load serializer class map