1111use Codeception \Lib \Interfaces \DependsOnModule ;
1212use Codeception \Lib \Interfaces \DoctrineProvider ;
1313use Codeception \Module as CodeceptionModule ;
14+ use Codeception \Stub ;
1415use Codeception \TestInterface ;
1516use Codeception \Util \ReflectionPropertyAccessor ;
16- use Codeception \Util \Stub ;
1717use Doctrine \Common \Collections \Criteria ;
1818use Doctrine \Common \Collections \Expr \Expression ;
1919use Doctrine \Common \DataFixtures \Executor \ORMExecutor ;
@@ -168,7 +168,7 @@ class Doctrine2 extends CodeceptionModule implements DependsOnModule, DataMapper
168168
169169 public ?EntityManagerInterface $ em = null ;
170170
171- public function _depends ()
171+ public function _depends (): array
172172 {
173173 if ($ this ->config ['connection_callback ' ]) {
174174 return [];
@@ -177,26 +177,17 @@ public function _depends()
177177 return [DoctrineProvider::class => $ this ->dependencyMessage ];
178178 }
179179
180- /**
181- * @return void
182- */
183- public function _inject (DoctrineProvider $ dependentModule = null )
180+ public function _inject (DoctrineProvider $ dependentModule = null ): void
184181 {
185182 $ this ->dependentModule = $ dependentModule ;
186183 }
187184
188- /**
189- * @return void
190- */
191- public function _beforeSuite ($ settings = [])
185+ public function _beforeSuite ($ settings = []): void
192186 {
193187 $ this ->retrieveEntityManager ();
194188 }
195189
196- /**
197- * @return void
198- */
199- public function _before (TestInterface $ test )
190+ public function _before (TestInterface $ test ): void
200191 {
201192 $ this ->cleanupEntityManager ();
202193 }
@@ -836,7 +827,7 @@ private function populateEmbeddables(object $entityObject, array $data): void
836827 * @param array $params
837828 * @return void
838829 */
839- public function seeInRepository ($ entity , $ params = [])
830+ public function seeInRepository (string $ entity , array $ params = []): void
840831 {
841832 $ res = $ this ->proceedSeeInRepository ($ entity , $ params );
842833 $ this ->assert ($ res );
@@ -849,7 +840,7 @@ public function seeInRepository($entity, $params = [])
849840 * @param array $params
850841 * @return void
851842 */
852- public function dontSeeInRepository ($ entity , $ params = [])
843+ public function dontSeeInRepository (string $ entity , array $ params = []): void
853844 {
854845 $ res = $ this ->proceedSeeInRepository ($ entity , $ params );
855846 $ this ->assertNot ($ res );
@@ -891,7 +882,7 @@ protected function proceedSeeInRepository(string $entity, array $params = []): a
891882 * @param array $params
892883 * @return mixed
893884 */
894- public function grabFromRepository ($ entity , $ field , $ params = [])
885+ public function grabFromRepository (string $ entity , string $ field , array $ params = [])
895886 {
896887 // we need to store to database...
897888 $ this ->em ->flush ();
@@ -995,11 +986,7 @@ protected function _buildAssociationQuery(QueryBuilder $qb, string $assoc, strin
995986 }
996987 }
997988
998- /**
999- * @return \Doctrine\ORM\EntityManagerInterface
1000- * @throws ModuleConfigException
1001- */
1002- public function _getEntityManager ()
989+ public function _getEntityManager (): EntityManagerInterface
1003990 {
1004991 if (is_null ($ this ->em )) {
1005992 $ this ->retrieveEntityManager ();
0 commit comments