1/* Loops through all loaded classes (get_declared_classes()) and
2returns an array of subclasses of the provided $parent */
3function getSubclasses(string $parent):array {
4 return array_reduce(get_declared_classes(), function($subclasses, $class) use ($parent) {
5 if (is_subclass_of($class, $parent)) {
6 $subclasses[] = $class;
7 }
8 return $subclasses;
9 }, []);
10}