src/ResourceResolver.php
protected function findParent(\ReflectionClass $class, $parents)
    {
        $parents = array_reverse($parents);

        foreach (array_reverse($parents) as $parent) {
            if ($class->getName() === get_class($parent)) {
                return $parent;
            }
        }

        foreach (array_reverse($parents) as $parent) {
            if ($class->isInstance($parent)) {
                return $parent;
            }
        }

        return null;
    }
protected function findParent(\ReflectionClass $class, $parents)
    {
        $parents = array_reverse($parents);

        foreach (array_reverse($parents) as $parent) {
            if ($class->getName() === get_class($parent)) {
                return $parent;
            }
        }

        foreach (array_reverse($parents) as $parent) {
            if ($class->isInstance($parent)) {
                return $parent;
            }
        }

        return null;
    }
protected function findParent ( \ ReflectionClass $ class , $ parents ) { $ parents = array_reverse ( $ parents ) ; foreach ( array_reverse ( $ parents ) as $ parent ) { if ( $ class -> getName ( ) === get_class ( $ parent ) ) { return $ parent ; } } foreach ( array_reverse ( $ parents ) as $ parent ) { if ( $ class -> isInstance ( $ parent ) ) { return $ parent ; } } return null ; }
Try to find a parent that matches the class

@param \ReflectionClass $class
@param array $parents
@return mixed|null
Try to find a parent that matches the class