diff --git a/src/index.js b/src/index.js index d3aaec4fa..2233ab106 100644 --- a/src/index.js +++ b/src/index.js @@ -199,8 +199,8 @@ Engine.tokenGetAll = function (buffer, options) { /** * Extract tokens from the specified buffer. * > Note that the output tokens are *STRICLY* similar to PHP function `token_get_all` - * @param {String} buffer - * @return {String[]} - Each item can be a string or an array with following informations [token_name, text, line_number] + * @param {string} buffer + * @return {Array} - Each item can be a string or an array with following informations [token_name, text, line_number] */ Engine.prototype.tokenGetAll = function (buffer) { this.lexer.mode_eval = false; diff --git a/types.d.ts b/types.d.ts index d0b17f82a..cc202d9e2 100644 --- a/types.d.ts +++ b/types.d.ts @@ -990,7 +990,7 @@ declare module "php-parser" { * > Note that the output tokens are *STRICLY* similar to PHP function `token_get_all` * @returns - Each item can be a string or an array with following informations [token_name, text, line_number] */ - tokenGetAll(buffer: string): String[]; + tokenGetAll(buffer: string): (string | string[])[]; lexer: Lexer; parser: Parser; ast: AST;