File tree Expand file tree Collapse file tree 2 files changed +24
-7
lines changed
tests/Rules/Exceptions/data Expand file tree Collapse file tree 2 files changed +24
-7
lines changed Original file line number Diff line number Diff line change @@ -60,11 +60,20 @@ interface EntityManagerInterface extends ObjectManager
6060 */
6161 public function copy($entity, $deep = false);
6262
63- /**
64- * @template T of object
65- * @phpstan-param class-string<T> $className
66- *
67- * @phpstan-return ClassMetadata<T>
68- */
69- public function getClassMetadata($className);
63+ /**
64+ * @return void
65+ *
66+ * @throws ORMException
67+ * @throws \Doctrine\DBAL\Exception\UniqueConstraintViolationException
68+ */
69+ public function flush();
70+
71+ /**
72+ * @template T of object
73+ * @phpstan-param class-string<T> $className
74+ *
75+ * @phpstan-return ClassMetadata<T>
76+ */
77+ public function getClassMetadata($className);
78+
7079}
Original file line number Diff line number Diff line change @@ -8,13 +8,21 @@ class FooFacade
88 /** @var \Doctrine\ORM\EntityManager */
99 private $ entityManager ;
1010
11+ /** @var \Doctrine\ORM\EntityManagerInterface */
12+ private $ entityManagerInterface ;
13+
1114 public function doFoo (): void
1215 {
1316 try {
1417 $ this ->entityManager ->flush ();
1518 } catch (\Doctrine \DBAL \Exception \UniqueConstraintViolationException $ e ) {
1619 // pass
1720 }
21+ try {
22+ $ this ->entityManagerInterface ->flush ();
23+ } catch (\Doctrine \DBAL \Exception \UniqueConstraintViolationException $ e ) {
24+ // pass
25+ }
1826 }
1927
2028}
You can’t perform that action at this time.
0 commit comments