Skip to content

Commit 44057b4

Browse files
authored
Merge pull request #11845 from lacatoire/update-message-annotation-to-attribute
Update message of `ORMInvalidArgumentException`
2 parents 013df03 + 2d2a344 commit 44057b4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/ORMInvalidArgumentException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ private static function newEntityFoundThroughRelationshipMessage(array $associat
309309
. ' configured to cascade persist operations for entity: ' . self::objToStr($entity) . '.'
310310
. ' To solve this issue: Either explicitly call EntityManager#persist()'
311311
. ' on this unknown entity or configure cascade persist'
312-
. ' this association in the mapping for example @ManyToOne(..,cascade={"persist"}).'
312+
. ' this association in the mapping for example #[ORM\ManyToOne(..., cascade: [\'persist\'])].'
313313
. (method_exists($entity, '__toString')
314314
? ''
315315
: ' If you cannot find out which entity causes the problem implement \''

tests/Tests/ORM/ORMInvalidArgumentExceptionTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function __toString(): string
8585
. 'persist operations for entity: stdClass@' . spl_object_id($entity1)
8686
. '. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity '
8787
. 'or configure cascade persist this association in the mapping for example '
88-
. '@ManyToOne(..,cascade={"persist"}). If you cannot find out which entity causes the problem '
88+
. '#[ORM\ManyToOne(..., cascade: [\'persist\'])]. If you cannot find out which entity causes the problem '
8989
. 'implement \'baz1#__toString()\' to get a clue.',
9090
],
9191
'two entities found' => [
@@ -104,13 +104,13 @@ public function __toString(): string
104104
. 'cascade persist operations for entity: stdClass@' . spl_object_id($entity1) . '. '
105105
. 'To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity '
106106
. 'or configure cascade persist this association in the mapping for example '
107-
. '@ManyToOne(..,cascade={"persist"}). If you cannot find out which entity causes the problem '
107+
. '#[ORM\ManyToOne(..., cascade: [\'persist\'])]. If you cannot find out which entity causes the problem '
108108
. 'implement \'baz1#__toString()\' to get a clue.' . "\n"
109109
. ' * A new entity was found through the relationship \'foo2#bar2\' that was not configured to '
110110
. 'cascade persist operations for entity: stdClass@' . spl_object_id($entity2) . '. To solve '
111111
. 'this issue: Either explicitly call EntityManager#persist() on this unknown entity or '
112112
. 'configure cascade persist this association in the mapping for example '
113-
. '@ManyToOne(..,cascade={"persist"}). If you cannot find out which entity causes the problem '
113+
. '#[ORM\ManyToOne(..., cascade: [\'persist\'])]. If you cannot find out which entity causes the problem '
114114
. 'implement \'baz2#__toString()\' to get a clue.',
115115
],
116116
'two entities found, one is stringable' => [
@@ -124,7 +124,7 @@ public function __toString(): string
124124
. 'persist operations for entity: ThisIsAStringRepresentationOfEntity3'
125125
. '. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity '
126126
. 'or configure cascade persist this association in the mapping for example '
127-
. '@ManyToOne(..,cascade={"persist"}).',
127+
. '#[ORM\ManyToOne(..., cascade: [\'persist\'])].',
128128
],
129129
];
130130
}

0 commit comments

Comments
 (0)