annotations icon indicating copy to clipboard operation
annotations copied to clipboard

Problem with autoloaded classes that aren't namespaced and have the same name as any docblock comment

Open deresh opened this issue 9 years ago • 3 comments

I have an part of legacy application that is added in symfony and i have a problem with annitationparser.

Annotation parser finds "@author" annotation, then immediatly tries to find annotation class for this annotation.

It finds my class named "author" (it's withouth namespace), properly parses it as not annotation (annotation metadata array has "is_annotation" set to false.

But then in DocParser.php (line 749) it does additional check for "author" class and this fails, as it check if this class is in array $this->ignoredAnnotationNames (and this array is empty, it never gets set).

And AnnotationReader global ignored annotation names is checked later in code :/

deresh avatar Dec 23 '16 11:12 deresh

Can you make a failing test case ?

mikeSimonson avatar Dec 23 '16 11:12 mikeSimonson

@mikeSimonson: Hm, not sure if i can, but will try.

I have currently fixed this by altering annotation autoloader to skip my class.

deresh avatar Dec 23 '16 12:12 deresh

@deresh can you please check if your issue is fixed in 1.3.1 ?

Thanks

mikeSimonson avatar Dec 31 '16 14:12 mikeSimonson