Skip to content

Conversation

nikic
Copy link
Member

@nikic nikic commented Sep 29, 2020

No description provided.

function token_get_all(string $code, int $flags = 0): array {}

function token_name(int $token): string {}
function token_name(int $token_id): string {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just $name or $id?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ops, I didn't see your comment :)

function token_get_all(string $code, int $flags = 0): array {}

function token_name(int $token): string {}
function token_name(int $token_id): string {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be ok with $id too. E.g. filter_id() uses $name :D But I'm ok with using $token_id here, or changing $name to $filter_name in filter_id()

@kocsismate
Copy link
Member

One more comment: PHPToken::__construct() uses $text, and I think it should be $code, right? I'm not very familiar with this extension though.

@nikic
Copy link
Member Author

nikic commented Sep 29, 2020

One more comment: PHPToken::__construct() uses $text, and I think it should be $code, right? I'm not very familiar with this extension though.

In this case the $text parameter corresponds to the PhpToken::$text property.

@kocsismate
Copy link
Member

In this case the $text parameter corresponds to the PhpToken::$text property.

Thanks for the clarification! Then everything looks good now :)

@php-pulls php-pulls closed this in 5dd5569 Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants