doctrine / doctrine/annotations

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

Open
#109 3 comments 0 reactions 0 assignees View on GitHub
bug missing tests
Dominant language
PHP
Stars
6.7k
Forks
234
PR merge metrics
No merged PRs in 30d

Description

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 :/

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.