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;
    }