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

ComponentReflection::parseAnnotation: fix false positive annotation parsing #151

Merged
merged 1 commit into from Aug 1, 2016

Conversation

@mrtnzlml
Copy link
Contributor

mrtnzlml commented Aug 1, 2016

I know it's internal class, but I am using it anyway - so it's maybe my problem. And I know about this issue quite long, but with this commit I have to fix it. In current master you can have @privatex annotation and this test will pass:

Assert::same([TRUE], Reflection::parseAnnotation($rc, 'private'));

But I don't think this is right. Previously I was calling it like this:

$visible = ComponentReflection::parseAnnotation($actionReflection, 'public\\s');

But it's not possible now... :)

@dg

This comment has been minimized.

Copy link
Member

dg commented Aug 1, 2016

Good point. \w is not enough, char - must not follow too. Probably better will be white-list, i.e. '(?:\(\s*([^)]*)\s*\)|\s|$)#'

@mrtnzlml

This comment has been minimized.

Copy link
Contributor Author

mrtnzlml commented Aug 1, 2016

Yes, I need to practice regular expressions more - thanks. Updated... :)

@dg

This comment has been minimized.

Copy link
Member

dg commented Aug 1, 2016

Great, thx!

@dg dg merged commit d1b379c into nette:master Aug 1, 2016
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 76.721%
Details
@mrtnzlml mrtnzlml deleted the mrtnzlml:parseAnnotation branch Aug 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.