protected function findClasses(string $namespace, array $dirs, array $excludes = []): array
	{
		$loader = $this->createLoader();
		$loader->addDirectory($dirs);
		$loader->rebuild();

		$indexed = $loader->getIndexedClasses();
		$classes = [];
		foreach ($indexed as $class => $file) {
			// Different namespace
			if (!Strings::startsWith($class, $namespace)) continue;

			// Excluded namespace
			if (array_filter($excludes, function (string $exclude) use ($class): bool {
				return Strings::startsWith($class, $exclude);
			}) !== []) continue;

			// Skip not existing class
			if (!class_exists($class, true)) continue;

			// Detect by reflection
			$ct = new ReflectionClass($class);

			// Skip abstract
			if ($ct->isAbstract()) continue;

			// All tests passed, it's our class
			$classes[] = $class;
		}

		return $classes;
	}
protected function findClasses(string $namespace, array $dirs, array $excludes = []): array
	{
		$loader = $this->createLoader();
		$loader->addDirectory($dirs);
		$loader->rebuild();

		$indexed = $loader->getIndexedClasses();
		$classes = [];
		foreach ($indexed as $class => $file) {
			// Different namespace
			if (!Strings::startsWith($class, $namespace)) continue;

			// Excluded namespace
			if (array_filter($excludes, function (string $exclude) use ($class): bool {
				return Strings::startsWith($class, $exclude);
			}) !== []) continue;

			// Skip not existing class
			if (!class_exists($class, true)) continue;

			// Detect by reflection
			$ct = new ReflectionClass($class);

			// Skip abstract
			if ($ct->isAbstract()) continue;

			// All tests passed, it's our class
			$classes[] = $class;
		}

		return $classes;
	}
protected function findClasses ( string $ namespace , array $ dirs , array $ excludes = [ ] ) : array { $ loader = $ this -> createLoader ( ) ; $ loader -> addDirectory ( $ dirs ) ; $ loader -> rebuild ( ) ; $ indexed = $ loader -> getIndexedClasses ( ) ; $ classes = [ ] ; foreach ( $ indexed as $ class => $ file ) { // Different namespace if ( ! Strings :: startsWith ( $ class , $ namespace ) ) continue ; // Excluded namespace if ( array_filter ( $ excludes , function ( string $ exclude ) use ( $ class ) : bool { return Strings :: startsWith ( $ class , $ exclude ) ; } ) !== [ ] ) continue ; // Skip not existing class if ( ! class_exists ( $ class , true ) ) continue ; // Detect by reflection $ ct = new ReflectionClass ( $ class ) ; // Skip abstract if ( $ ct -> isAbstract ( ) ) continue ; // All tests passed, it's our class $ classes [ ] = $ class ; } return $ classes ; }
Find classes by given arguments

@param string[] $dirs
@param string[] $excludes
@return string[]
Find classes by given arguments