public static function getParents($instance, $stopAt = [])
    {
        $reflectionClass = new \ReflectionObject($instance);

        $parents = [];
        while ($reflectionClass->getParentClass()) {
            $reflectionClass = $reflectionClass->getParentClass();
            if (in_array($reflectionClass->getName(), $stopAt)) {
                break;
            }
            $parents[$reflectionClass->getName()] = $reflectionClass;
        }

        return $parents;
    }
public static function getParents($instance, $stopAt = [])
    {
        $reflectionClass = new \ReflectionObject($instance);

        $parents = [];
        while ($reflectionClass->getParentClass()) {
            $reflectionClass = $reflectionClass->getParentClass();
            if (in_array($reflectionClass->getName(), $stopAt)) {
                break;
            }
            $parents[$reflectionClass->getName()] = $reflectionClass;
        }

        return $parents;
    }
public static function getParents ( $ instance , $ stopAt = [ ] ) { $ reflectionClass = new \ ReflectionObject ( $ instance ) ; $ parents = [ ] ; while ( $ reflectionClass -> getParentClass ( ) ) { $ reflectionClass = $ reflectionClass -> getParentClass ( ) ; if ( in_array ( $ reflectionClass -> getName ( ) , $ stopAt ) ) { break ; } $ parents [ $ reflectionClass -> getName ( ) ] = $ reflectionClass ; } return $ parents ; }
Returns all the parents for the instance from the youngest to the oldest
The resolution order to follow when going up a inheritance hierarchy.

@return array this an array of ReflectionClass

@since  1.1.0

@author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com>
Returns all the parents for the instance from the youngest to the oldest The resolution order to follow when going up a inheritance hierarchy .