File tree 2 files changed +24
-7
lines changed
tests/Rules/Exceptions/data
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
60
60
*/
61
61
public function copy($entity, $deep = false);
62
62
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
+
70
79
}
Original file line number Diff line number Diff line change @@ -8,13 +8,21 @@ class FooFacade
8
8
/** @var \Doctrine\ORM\EntityManager */
9
9
private $ entityManager ;
10
10
11
+ /** @var \Doctrine\ORM\EntityManagerInterface */
12
+ private $ entityManagerInterface ;
13
+
11
14
public function doFoo (): void
12
15
{
13
16
try {
14
17
$ this ->entityManager ->flush ();
15
18
} catch (\Doctrine \DBAL \Exception \UniqueConstraintViolationException $ e ) {
16
19
// pass
17
20
}
21
+ try {
22
+ $ this ->entityManagerInterface ->flush ();
23
+ } catch (\Doctrine \DBAL \Exception \UniqueConstraintViolationException $ e ) {
24
+ // pass
25
+ }
18
26
}
19
27
20
28
}
You can’t perform that action at this time.
0 commit comments