src/ResourceResolver.php
private function getResolverForType($type)
    {
        $resolver = Arr::get($this->resolvers, $type);

        if ($resolver !== null) {
            return $resolver;
        }

        $parts = explode('.', $type);
        if (count($parts) > 1) {
            array_shift($parts);

            return $this->getResolverForType(implode('.', $parts));
        }

        return null;
    }
private function getResolverForType($type)
    {
        $resolver = Arr::get($this->resolvers, $type);

        if ($resolver !== null) {
            return $resolver;
        }

        $parts = explode('.', $type);
        if (count($parts) > 1) {
            array_shift($parts);

            return $this->getResolverForType(implode('.', $parts));
        }

        return null;
    }
private function getResolverForType ( $ type ) { $ resolver = Arr :: get ( $ this -> resolvers , $ type ) ; if ( $ resolver !== null ) { return $ resolver ; } $ parts = explode ( '.' , $ type ) ; if ( count ( $ parts ) > 1 ) { array_shift ( $ parts ) ; return $ this -> getResolverForType ( implode ( '.' , $ parts ) ) ; } return null ; }
Find the resolver for the type given

Fallback the specificity of the type until we find a match. For example
if a type of customer.products.customer_product is passed we first check
for that, then products.customer_product and then customer_product.

@param string $type
@return mixed
Find the resolver for the type given