diff --git a/src/ORMInvalidArgumentException.php b/src/ORMInvalidArgumentException.php index 2181d207c28..b2db07ff43b 100644 --- a/src/ORMInvalidArgumentException.php +++ b/src/ORMInvalidArgumentException.php @@ -309,7 +309,7 @@ private static function newEntityFoundThroughRelationshipMessage(array $associat . ' configured to cascade persist operations for entity: ' . self::objToStr($entity) . '.' . ' To solve this issue: Either explicitly call EntityManager#persist()' . ' on this unknown entity or configure cascade persist' - . ' this association in the mapping for example @ManyToOne(..,cascade={"persist"}).' + . ' this association in the mapping for example #[ORM\ManyToOne(..., cascade: [\'persist\'])].' . (method_exists($entity, '__toString') ? '' : ' If you cannot find out which entity causes the problem implement \'' diff --git a/tests/Tests/ORM/ORMInvalidArgumentExceptionTest.php b/tests/Tests/ORM/ORMInvalidArgumentExceptionTest.php index e878bc067b6..6af40bd0d74 100644 --- a/tests/Tests/ORM/ORMInvalidArgumentExceptionTest.php +++ b/tests/Tests/ORM/ORMInvalidArgumentExceptionTest.php @@ -85,7 +85,7 @@ public function __toString(): string . 'persist operations for entity: stdClass@' . spl_object_id($entity1) . '. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity ' . 'or configure cascade persist this association in the mapping for example ' - . '@ManyToOne(..,cascade={"persist"}). If you cannot find out which entity causes the problem ' + . '#[ORM\ManyToOne(..., cascade: [\'persist\'])]. If you cannot find out which entity causes the problem ' . 'implement \'baz1#__toString()\' to get a clue.', ], 'two entities found' => [ @@ -104,13 +104,13 @@ public function __toString(): string . 'cascade persist operations for entity: stdClass@' . spl_object_id($entity1) . '. ' . 'To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity ' . 'or configure cascade persist this association in the mapping for example ' - . '@ManyToOne(..,cascade={"persist"}). If you cannot find out which entity causes the problem ' + . '#[ORM\ManyToOne(..., cascade: [\'persist\'])]. If you cannot find out which entity causes the problem ' . 'implement \'baz1#__toString()\' to get a clue.' . "\n" . ' * A new entity was found through the relationship \'foo2#bar2\' that was not configured to ' . 'cascade persist operations for entity: stdClass@' . spl_object_id($entity2) . '. To solve ' . 'this issue: Either explicitly call EntityManager#persist() on this unknown entity or ' . 'configure cascade persist this association in the mapping for example ' - . '@ManyToOne(..,cascade={"persist"}). If you cannot find out which entity causes the problem ' + . '#[ORM\ManyToOne(..., cascade: [\'persist\'])]. If you cannot find out which entity causes the problem ' . 'implement \'baz2#__toString()\' to get a clue.', ], 'two entities found, one is stringable' => [ @@ -124,7 +124,7 @@ public function __toString(): string . 'persist operations for entity: ThisIsAStringRepresentationOfEntity3' . '. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity ' . 'or configure cascade persist this association in the mapping for example ' - . '@ManyToOne(..,cascade={"persist"}).', + . '#[ORM\ManyToOne(..., cascade: [\'persist\'])].', ], ]; }