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