public static function getClasses(string $file): array
	{
		$php_code = file_get_contents($file);
		$classes = [];
		$tokens = token_get_all($php_code);
		$count = count($tokens);
		for ($i = 2; $i < $count; $i++) {
			if ($tokens[$i - 2][0] == T_CLASS && $tokens[$i - 1][0] == T_WHITESPACE && $tokens[$i][0] == T_STRING) {
				$class_name = $tokens[$i][1];
				$classes[] = $class_name;
			}
		}
		return $classes;
	}
public static function getClasses(string $file): array
	{
		$php_code = file_get_contents($file);
		$classes = [];
		$tokens = token_get_all($php_code);
		$count = count($tokens);
		for ($i = 2; $i < $count; $i++) {
			if ($tokens[$i - 2][0] == T_CLASS && $tokens[$i - 1][0] == T_WHITESPACE && $tokens[$i][0] == T_STRING) {
				$class_name = $tokens[$i][1];
				$classes[] = $class_name;
			}
		}
		return $classes;
	}
public static function getClasses ( string $ file ) : array { $ php_code = file_get_contents ( $ file ) ; $ classes = [ ] ; $ tokens = token_get_all ( $ php_code ) ; $ count = count ( $ tokens ) ; for ( $ i = 2 ; $ i < $ count ; $ i ++ ) { if ( $ tokens [ $ i - 2 ] [ 0 ] == T_CLASS && $ tokens [ $ i - 1 ] [ 0 ] == T_WHITESPACE && $ tokens [ $ i ] [ 0 ] == T_STRING ) { $ class_name = $ tokens [ $ i ] [ 1 ] ; $ classes [ ] = $ class_name ; } } return $ classes ; }
Vrati nazvy trid v souboru
@param string $file
@return string[]
Vrati nazvy trid v souboru