Skip to content
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

$this->trait is seen as a T_TRAIT token #784

Closed
msteltenpool opened this issue Nov 24, 2015 · 2 comments
Closed

$this->trait is seen as a T_TRAIT token #784

msteltenpool opened this issue Nov 24, 2015 · 2 comments

Comments

@msteltenpool
Copy link

public function register()
{
    return [T_TRAIT];
}

It will spot this '$this->trait' as a T_TRAIT that it needs to return. Didn't check the underlying reason, but my tests suddenly trigger on places where it shouldn't after the 2.4.0 update.

@aik099
Copy link
Contributor

aik099 commented Nov 24, 2015

That seems to be a side effect from allowing parsing PHP 5.4+ code on PHP 5.3 and below, where T_TRAIT token doesn't exist. @gsherwood , we can just check if { is present (excluding whitespaces) after the trait word and only then consider it as T_TRAIT.

@gsherwood gsherwood changed the title $this->trait; is seen as a T_TRAIT token. $this->trait is seen as a T_TRAIT token Nov 24, 2015
@gsherwood
Copy link
Member

Thanks for reporting this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants