src/ResourceBuilder/BaseResourceBuilder.php
private function determineMapperFqcn(array $data)
    {
        $type = $this->getSystemType($data);
        $fqcn = $this->mapperNamespace.'\\'.$type;

        if (isset($this->dataMapperMatchers[$type])) {
            $matchedFqcn = $this->dataMapperMatchers[$type]($data);

            if (!$matchedFqcn) {
                return $fqcn;
            }

            if (!\class_exists($matchedFqcn, \true)) {
                throw new \RuntimeException(\sprintf(
                    'Mapper class "%s" does not exist.',
                    $matchedFqcn
                ));
            }

            return $matchedFqcn;
        }

        return $fqcn;
    }
private function determineMapperFqcn(array $data)
    {
        $type = $this->getSystemType($data);
        $fqcn = $this->mapperNamespace.'\\'.$type;

        if (isset($this->dataMapperMatchers[$type])) {
            $matchedFqcn = $this->dataMapperMatchers[$type]($data);

            if (!$matchedFqcn) {
                return $fqcn;
            }

            if (!\class_exists($matchedFqcn, \true)) {
                throw new \RuntimeException(\sprintf(
                    'Mapper class "%s" does not exist.',
                    $matchedFqcn
                ));
            }

            return $matchedFqcn;
        }

        return $fqcn;
    }
private function determineMapperFqcn ( array $ data ) { $ type = $ this -> getSystemType ( $ data ) ; $ fqcn = $ this -> mapperNamespace . '\\' . $ type ; if ( isset ( $ this -> dataMapperMatchers [ $ type ] ) ) { $ matchedFqcn = $ this -> dataMapperMatchers [ $ type ] ( $ data ) ; if ( ! $ matchedFqcn ) { return $ fqcn ; } if ( ! \ class_exists ( $ matchedFqcn , \ true ) ) { throw new \ RuntimeException ( \ sprintf ( 'Mapper class "%s" does not exist.' , $ matchedFqcn ) ) ; } return $ matchedFqcn ; } return $ fqcn ; }
Determines the fully-qualified class name of the mapper object
that will handle the mapping process.

This function will use user-defined data matchers, if available.

If the user-defined matcher does not return anything,
we default to the base mapper, so the user doesn't have
to manually return the default value.

@param array $data The raw API data

@return string The mapper's fully-qualified class name
Determines the fully - qualified class name of the mapper object that will handle the mapping process .