DDC-1158: validate-schema does not warn about incorrect double @Entity annotation #1455

Closed
opened 2026-01-22 13:15:02 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (May 18, 2011).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user jhartikainen:

If you have an incorrect annotation with two @Entity annotations, validate-schema does not correctly detect it. Instead, it displays a warning

PHP Notice: Trying to get property of non-object in library/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php on line 134

Additionally, this causes schema-tool update to display the same warning as well.

Here's the annotations which causes this:

/****
 * @Entity()
 * @Table(name="example")
 * @Entity(repositoryClass="ExampleRepository")
 */
class ExampleEntity {

}

While it's obviously an incorrect annotation, I would expect validate-schema to warn about it. The case with schema-tool is less clear, perhaps it could display an error instead of just a PHP notice and continuing fine otherwise.

Originally created by @doctrinebot on GitHub (May 18, 2011). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user jhartikainen: If you have an incorrect annotation with two @Entity annotations, validate-schema does not correctly detect it. Instead, it displays a warning PHP Notice: Trying to get property of non-object in library/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php on line 134 Additionally, this causes schema-tool update to display the same warning as well. Here's the annotations which causes this: ``` /**** * @Entity() * @Table(name="example") * @Entity(repositoryClass="ExampleRepository") */ class ExampleEntity { } ``` While it's obviously an incorrect annotation, I would expect validate-schema to warn about it. The case with schema-tool is less clear, perhaps it could display an error instead of just a PHP notice and continuing fine otherwise.
admin added the Bug label 2026-01-22 13:15:02 +01:00
admin closed this issue 2026-01-22 13:15:03 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jun 5, 2011):

Comment created by @beberlei:

This cant be fixed in the annotation driver but in the AnnotaitonParser. After the reworking of it it may be done, this will be done for the driver rerffactoring.

@doctrinebot commented on GitHub (Jun 5, 2011): Comment created by @beberlei: This cant be fixed in the annotation driver but in the AnnotaitonParser. After the reworking of it it may be done, this will be done for the driver rerffactoring.
Author
Owner

@doctrinebot commented on GitHub (Jun 5, 2011):

Issue was closed with resolution "Can't Fix"

@doctrinebot commented on GitHub (Jun 5, 2011): Issue was closed with resolution "Can't Fix"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1455