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

Open
opened 2026-01-22 13:14:59 +01:00 by admin · 0 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:14:59 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1452