Skip to content

annotation @method not correctly parsed #278

Description

@ncou

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions