Skip to content

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

Merged
dg merged 1 commit into
nette:masterfrom
mrtnzlml:parseAnnotation
Aug 1, 2016
Merged

ComponentReflection::parseAnnotation: fix false positive annotation parsing#151
dg merged 1 commit into
nette:masterfrom
mrtnzlml:parseAnnotation

Conversation

@mrtnzlml

@mrtnzlml mrtnzlml commented Aug 1, 2016

Copy link
Copy Markdown
Contributor

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

dg commented Aug 1, 2016

Copy link
Copy Markdown
Member

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

@mrtnzlml

mrtnzlml commented Aug 1, 2016

Copy link
Copy Markdown
Contributor Author

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

@dg

dg commented Aug 1, 2016

Copy link
Copy Markdown
Member

Great, thx!

@dg
dg merged commit d1b379c into nette:master Aug 1, 2016
@mrtnzlml
mrtnzlml deleted the parseAnnotation branch August 1, 2016 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants