Skip to content

Update ext/tokenizer param names #6232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Conversation

nikic
Copy link
Member

@nikic nikic commented Sep 29, 2020

No description provided.


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_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