22
33namespace App \Console ;
44
5- use App \Model \Entity \Assignment ;
6- use App \Model \Entity \Exercise ;
7- use App \Model \Entity \SolutionEvaluation ;
85use App \Model \Repository \Exercises ;
96use DateTime ;
107use Exception ;
11- use Doctrine \DBAL \Connection ;
8+ use Doctrine \DBAL \ArrayParameterType ;
129use Doctrine \ORM \EntityManagerInterface ;
1310use Symfony \Component \Console \Command \Command ;
1411use Symfony \Component \Console \Input \InputInterface ;
@@ -60,7 +57,7 @@ private function cleanupEnvironmentConfigs(DateTime $limit): int
6057 $ deleteQuery = $ this ->entityManager ->createQuery (
6158 'DELETE FROM App\Model\Entity\ExerciseEnvironmentConfig c WHERE c.id IN (:ids) '
6259 );
63- $ deleteQuery ->setParameter ("ids " , $ ids , Connection:: PARAM_STR_ARRAY );
60+ $ deleteQuery ->setParameter ("ids " , $ ids , ArrayParameterType:: STRING );
6461 return $ deleteQuery ->execute ();
6562 }
6663
@@ -115,7 +112,7 @@ private function cleanupLimits(DateTime $limit): int
115112 $ deleteQuery = $ this ->entityManager ->createQuery (
116113 'DELETE FROM App\Model\Entity\ExerciseLimits l WHERE l.id IN (:ids) '
117114 );
118- $ deleteQuery ->setParameter ("ids " , $ ids , Connection:: PARAM_STR_ARRAY );
115+ $ deleteQuery ->setParameter ("ids " , $ ids , ArrayParameterType:: STRING );
119116 return $ deleteQuery ->execute ();
120117 }
121118
@@ -137,7 +134,7 @@ private function cleanupTests(DateTime $limit): int
137134 $ deleteQuery = $ this ->entityManager ->createQuery (
138135 'DELETE FROM App\Model\Entity\ExerciseTest t WHERE t.id IN (:ids) '
139136 );
140- $ deleteQuery ->setParameter ("ids " , $ ids , Connection:: PARAM_STR_ARRAY );
137+ $ deleteQuery ->setParameter ("ids " , $ ids , ArrayParameterType:: STRING );
141138 return $ deleteQuery ->execute ();
142139 }
143140
@@ -152,7 +149,7 @@ protected function executeUnsafe(DateTime $limit, OutputInterface $output)
152149 'Tests ' ,
153150 ];
154151
155- $ report = [ 'Removed: ' ];
152+ $ report = ['Removed: ' ];
156153 foreach ($ toDelete as $ key ) {
157154 $ method = "cleanup $ key " ;
158155 $ deletedCount = $ this ->$ method ($ limit );
0 commit comments