private static function classNameByTokens($phpCode)
    {
        $classes = [];
        $tokens = token_get_all($phpCode);
        $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) {
                $classes[] = $tokens[$i][1];
            }
        }
        
        return $classes;
    }
private static function classNameByTokens($phpCode)
    {
        $classes = [];
        $tokens = token_get_all($phpCode);
        $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) {
                $classes[] = $tokens[$i][1];
            }
        }
        
        return $classes;
    }
private static function classNameByTokens ( $ phpCode ) { $ classes = [ ] ; $ tokens = token_get_all ( $ phpCode ) ; $ 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 ) { $ classes [ ] = $ tokens [ $ i ] [ 1 ] ; } } return $ classes ; }
Tokenize the php code from a given class in in order to determine the class name.

@param string $phpCode The php code to tokenize and find the clas name from
@return array
Tokenize the php code from a given class in in order to determine the class name .