src/Loader.php
public static function getAllChildClasses($class): array
    {
        $type = gettype($class);
        $className = '';

        /* If input an object */
        if ($type == 'object') {
            $className = get_class($class);
        }

        /* If input a string */
        elseif ($type == 'string') {
            $className = $class;
        }

        $classes = [];

        /* Go through all classes */
        foreach (get_declared_classes() as $class) {
            if (is_subclass_of($class, $className)) {
                $classes[] = $class;
            }
        }

        return $classes;
    }
public static function getAllChildClasses($class): array
    {
        $type = gettype($class);
        $className = '';

        /* If input an object */
        if ($type == 'object') {
            $className = get_class($class);
        }

        /* If input a string */
        elseif ($type == 'string') {
            $className = $class;
        }

        $classes = [];

        /* Go through all classes */
        foreach (get_declared_classes() as $class) {
            if (is_subclass_of($class, $className)) {
                $classes[] = $class;
            }
        }

        return $classes;
    }
public static function getAllChildClasses ( $ class ) : array { $ type = gettype ( $ class ) ; $ className = '' ; /* If input an object */ if ( $ type == 'object' ) { $ className = get_class ( $ class ) ; } /* If input a string */ elseif ( $ type == 'string' ) { $ className = $ class ; } $ classes = [ ] ; /* Go through all classes */ foreach ( get_declared_classes ( ) as $ class ) { if ( is_subclass_of ( $ class , $ className ) ) { $ classes [ ] = $ class ; } } return $ classes ; }
Get all child classes of a class

@param string|object $class
@return array
Get all child classes of a class