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

annotation @method not correctly parsed #278

Closed
ncou opened this issue Jan 28, 2022 · 1 comment
Closed

annotation @method not correctly parsed #278

ncou opened this issue Jan 28, 2022 · 1 comment

Comments

@ncou
Copy link

ncou commented Jan 28, 2022

Hi,

Nice piece of code. I think there is a problem when reading the @method annotation.

self::parseFullDoc(new \ReflectionClass($class), '~^[ \t*]*@method[ \t]+(?:\S+[ \t]+)??(\w+)\(~m'),

the format of the annotation can be of 2 type (static method or not) as documented here : https://doc.nette.org/en/contributing/coding-standard#toc-documentation-blocks-phpdoc

But the parsing is not correct if there is a "static" word instead of the return type.

Here is an example using the nette regex : https://sandbox.onlinephpfunctions.com/code/d381c1f6eefc80b3dd84292a514ff935eddf3e13

As you can see the array is only filed with the first method. If you remove the "static" word the array will be filled with the 2 methods name.

I hope i am clear enough.

Keep up the good work.

@dg dg closed this as completed in 32091bb Jan 28, 2022
@dg
Copy link
Member

dg commented Jan 28, 2022

Thanks, fixed

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

No branches or pull requests

2 participants