src/Mouf/Moufspector.php
public static function getComponentsList($type = null, $selfEdit = false) {
		//$composerService = new ComposerService($selfEdit);
		$moufClassExplorer = new MoufClassExplorer($selfEdit);
		
		$classesList = array_keys($moufClassExplorer->getClassMap());
		
		// Let's add the list of PHP inner classes.
		$innerClasses = get_declared_classes();
		
		$classesList = array_merge($classesList, $innerClasses);
		$classesList = array_flip(array_flip($classesList));
		
		//$classesList = get_declared_classes();
		$componentsList = array();
		
		foreach ($classesList as $className) {
			$refClass = new MoufReflectionClass($className);
			if ($refClass->isInstantiable()) {
				if ($type == null) {
					$componentsList[] = $className;
				} else {
					try {
						if ($refClass->implementsInterface($type)) {
							$componentsList[] = $className;
							continue;
						}
					} catch (\ReflectionException $e) {
						// The interface might not exist, that's not a problem
					}
					try {
						if ($refClass->isSubclassOf($type)) {
							$componentsList[] = $className;
							continue;
						}
					} catch (\ReflectionException $e) {
						// The class might not exist, that's not a problem
					}
					if ($refClass->getName() == $type) {
						$componentsList[] = $className;
					}
				}
			}
		}
		return $componentsList;
	}
public static function getComponentsList($type = null, $selfEdit = false) {
		//$composerService = new ComposerService($selfEdit);
		$moufClassExplorer = new MoufClassExplorer($selfEdit);
		
		$classesList = array_keys($moufClassExplorer->getClassMap());
		
		// Let's add the list of PHP inner classes.
		$innerClasses = get_declared_classes();
		
		$classesList = array_merge($classesList, $innerClasses);
		$classesList = array_flip(array_flip($classesList));
		
		//$classesList = get_declared_classes();
		$componentsList = array();
		
		foreach ($classesList as $className) {
			$refClass = new MoufReflectionClass($className);
			if ($refClass->isInstantiable()) {
				if ($type == null) {
					$componentsList[] = $className;
				} else {
					try {
						if ($refClass->implementsInterface($type)) {
							$componentsList[] = $className;
							continue;
						}
					} catch (\ReflectionException $e) {
						// The interface might not exist, that's not a problem
					}
					try {
						if ($refClass->isSubclassOf($type)) {
							$componentsList[] = $className;
							continue;
						}
					} catch (\ReflectionException $e) {
						// The class might not exist, that's not a problem
					}
					if ($refClass->getName() == $type) {
						$componentsList[] = $className;
					}
				}
			}
		}
		return $componentsList;
	}
public static function getComponentsList ( $ type = null , $ selfEdit = false ) { //$composerService = new ComposerService($selfEdit);
 $ moufClassExplorer = new MoufClassExplorer ( $ selfEdit ) ; $ classesList = array_keys ( $ moufClassExplorer -> getClassMap ( ) ) ; // Let's add the list of PHP inner classes.
 $ innerClasses = get_declared_classes ( ) ; $ classesList = array_merge ( $ classesList , $ innerClasses ) ; $ classesList = array_flip ( array_flip ( $ classesList ) ) ; //$classesList = get_declared_classes();
 $ componentsList = array ( ) ; foreach ( $ classesList as $ className ) { $ refClass = new MoufReflectionClass ( $ className ) ; if ( $ refClass -> isInstantiable ( ) ) { if ( $ type == null ) { $ componentsList [ ] = $ className ; } else { try { if ( $ refClass -> implementsInterface ( $ type ) ) { $ componentsList [ ] = $ className ; continue ; } } catch ( \ ReflectionException $ e ) { // The interface might not exist, that's not a problem
 } try { if ( $ refClass -> isSubclassOf ( $ type ) ) { $ componentsList [ ] = $ className ; continue ; } } catch ( \ ReflectionException $ e ) { // The class might not exist, that's not a problem
 } if ( $ refClass -> getName ( ) == $ type ) { $ componentsList [ ] = $ className ; } } } } return $ componentsList ; }
Returns a list of all the classes, or only classes inheriting the passed
class or interface.  Classes that can't be instanciated are excluded from the list.

@type string the class or interface the class must inherit to be part of the list. If not passed, all classes are returned.
@return array<string>
Returns a list of all the classes or only classes inheriting the passed class or interface . Classes that can t be instanciated are excluded from the list .