Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Conversation

@1blankz7
Copy link

@1blankz7 1blankz7 commented Sep 8, 2018

The problem is that token_get_all will interpret nullables as token ? plus the type token. We currently strip all tokens which are no arrays. I have added a check which will change all ? into full tokens. My problem with this hack is, that we now interpret ternary operators and nullable as the same token.

This PR resolves #162 with a little hack.

"branch-alias": {
"dev-master": "4.0-dev"
}
},
Copy link
Owner

Choose a reason for hiding this comment

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

This project does not use PHPUnit installed via Composer.

@sebastianbergmann
Copy link
Owner

I think the solution is "too hacky".

@1blankz7
Copy link
Author

1blankz7 commented Sep 8, 2018

@sebastianbergmann So we have two options in my opinion:

  1. We switch to AST where we have the needed information.
  2. We live with the occurence of false positives.

@1blankz7 1blankz7 closed this Sep 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for nullable type declarations

2 participants