src/Tokenizer.php
public static function getTokens(string $filename): array
    {
        $tokens = token_get_all(file_get_contents($filename));

        $line = 0;
        foreach ($tokens as &$token) {
            if (isset($token[self::LINE])) {
                $line = $token[self::LINE];
            }

            if (!is_array($token)) {
                $token = [$token, $token, $line];
            }

            unset($token);
        }

        return $tokens;
    }
public static function getTokens(string $filename): array
    {
        $tokens = token_get_all(file_get_contents($filename));

        $line = 0;
        foreach ($tokens as &$token) {
            if (isset($token[self::LINE])) {
                $line = $token[self::LINE];
            }

            if (!is_array($token)) {
                $token = [$token, $token, $line];
            }

            unset($token);
        }

        return $tokens;
    }
public static function getTokens ( string $ filename ) : array { $ tokens = token_get_all ( file_get_contents ( $ filename ) ) ; $ line = 0 ; foreach ( $ tokens as & $ token ) { if ( isset ( $ token [ self :: LINE ] ) ) { $ line = $ token [ self :: LINE ] ; } if ( ! is_array ( $ token ) ) { $ token = [ $ token , $ token , $ line ] ; } unset ( $ token ) ; } return $ tokens ; }
Get all tokes for specific file.

@param string $filename
@return array
Get all tokes for specific file .