diff --git a/src/Bundle/ChillEventBundle/Controller/EventController.php b/src/Bundle/ChillEventBundle/Controller/EventController.php index a07d36ee1..0dcaf176a 100644 --- a/src/Bundle/ChillEventBundle/Controller/EventController.php +++ b/src/Bundle/ChillEventBundle/Controller/EventController.php @@ -97,7 +97,7 @@ class EventController extends AbstractController public function deleteAction($event_id, Request $request) { $em = $this->getDoctrine()->getManager(); - $event = $em->getRepository('ChillEventBundle:Event')->findOneBy([ + $event = $em->getRepository(\Chill\EventBundle\Entity\Event::class)->findOneBy([ 'id' => $event_id, ]); @@ -151,7 +151,7 @@ class EventController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository('ChillEventBundle:Event')->find($event_id); + $entity = $em->getRepository(\Chill\EventBundle\Entity\Event::class)->find($event_id); if (!$entity) { throw $this->createNotFoundException('Unable to find Event entity.'); @@ -192,11 +192,11 @@ class EventController extends AbstractController $person->getCenter() ); - $total = $em->getRepository('ChillEventBundle:Participation')->countByPerson($person_id); + $total = $em->getRepository(\Chill\EventBundle\Entity\Participation::class)->countByPerson($person_id); $paginator = $this->paginator->create($total); - $participations = $em->getRepository('ChillEventBundle:Participation')->findByPersonInCircle( + $participations = $em->getRepository(\Chill\EventBundle\Entity\Participation::class)->findByPersonInCircle( $person_id, $reachablesCircles, $paginator->getCurrentPage()->getFirstItemNumber(), @@ -352,7 +352,7 @@ class EventController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository('ChillEventBundle:Event')->find($event_id); + $entity = $em->getRepository(\Chill\EventBundle\Entity\Event::class)->find($event_id); if (!$entity) { throw $this->createNotFoundException('Unable to find Event entity.'); diff --git a/src/Bundle/ChillEventBundle/Controller/EventTypeController.php b/src/Bundle/ChillEventBundle/Controller/EventTypeController.php index f1ced71a5..5db922dea 100644 --- a/src/Bundle/ChillEventBundle/Controller/EventTypeController.php +++ b/src/Bundle/ChillEventBundle/Controller/EventTypeController.php @@ -60,7 +60,7 @@ class EventTypeController extends AbstractController if ($form->isValid()) { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository('ChillEventBundle:EventType')->find($id); + $entity = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find EventType entity.'); @@ -82,7 +82,7 @@ class EventTypeController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository('ChillEventBundle:EventType')->find($id); + $entity = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find EventType entity.'); @@ -105,7 +105,7 @@ class EventTypeController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entities = $em->getRepository('ChillEventBundle:EventType')->findAll(); + $entities = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->findAll(); return $this->render('ChillEventBundle:EventType:index.html.twig', [ 'entities' => $entities, @@ -135,7 +135,7 @@ class EventTypeController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository('ChillEventBundle:EventType')->find($id); + $entity = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find EventType entity.'); @@ -158,7 +158,7 @@ class EventTypeController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository('ChillEventBundle:EventType')->find($id); + $entity = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find EventType entity.'); diff --git a/src/Bundle/ChillEventBundle/Controller/ParticipationController.php b/src/Bundle/ChillEventBundle/Controller/ParticipationController.php index 52fe3d867..da1569d3c 100644 --- a/src/Bundle/ChillEventBundle/Controller/ParticipationController.php +++ b/src/Bundle/ChillEventBundle/Controller/ParticipationController.php @@ -258,7 +258,7 @@ class ParticipationController extends AbstractController public function deleteAction($participation_id, Request $request) { $em = $this->getDoctrine()->getManager(); - $participation = $em->getRepository('ChillEventBundle:Participation')->findOneBy([ + $participation = $em->getRepository(\Chill\EventBundle\Entity\Participation::class)->findOneBy([ 'id' => $participation_id, ]); @@ -336,7 +336,7 @@ class ParticipationController extends AbstractController */ public function editMultipleAction($event_id) { - $event = $this->getDoctrine()->getRepository('ChillEventBundle:Event') + $event = $this->getDoctrine()->getRepository(\Chill\EventBundle\Entity\Event::class) ->find($event_id); if (null === $event) { @@ -467,7 +467,7 @@ class ParticipationController extends AbstractController public function updateMultipleAction($event_id, Request $request) { /** @var \Chill\EventBundle\Entity\Event $event */ - $event = $this->getDoctrine()->getRepository('ChillEventBundle:Event') + $event = $this->getDoctrine()->getRepository(\Chill\EventBundle\Entity\Event::class) ->find($event_id); if (null === $event) { @@ -569,7 +569,7 @@ class ParticipationController extends AbstractController // prevent error: `Argument 2 passed to ::getInt() must be of the type int, null given` if (null !== $event_id) { - $event = $em->getRepository('ChillEventBundle:Event') + $event = $em->getRepository(\Chill\EventBundle\Entity\Event::class) ->find($event_id); if (null === $event) { diff --git a/src/Bundle/ChillEventBundle/Controller/RoleController.php b/src/Bundle/ChillEventBundle/Controller/RoleController.php index a12a775da..8bf8affbd 100644 --- a/src/Bundle/ChillEventBundle/Controller/RoleController.php +++ b/src/Bundle/ChillEventBundle/Controller/RoleController.php @@ -60,7 +60,7 @@ class RoleController extends AbstractController if ($form->isValid()) { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository('ChillEventBundle:Role')->find($id); + $entity = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Role entity.'); @@ -82,7 +82,7 @@ class RoleController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository('ChillEventBundle:Role')->find($id); + $entity = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Role entity.'); @@ -105,7 +105,7 @@ class RoleController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entities = $em->getRepository('ChillEventBundle:Role')->findAll(); + $entities = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->findAll(); return $this->render('ChillEventBundle:Role:index.html.twig', [ 'entities' => $entities, @@ -135,7 +135,7 @@ class RoleController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository('ChillEventBundle:Role')->find($id); + $entity = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Role entity.'); @@ -158,7 +158,7 @@ class RoleController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository('ChillEventBundle:Role')->find($id); + $entity = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Role entity.'); diff --git a/src/Bundle/ChillEventBundle/Controller/StatusController.php b/src/Bundle/ChillEventBundle/Controller/StatusController.php index 72e80b27b..40f92cba4 100644 --- a/src/Bundle/ChillEventBundle/Controller/StatusController.php +++ b/src/Bundle/ChillEventBundle/Controller/StatusController.php @@ -57,7 +57,7 @@ class StatusController extends AbstractController if ($form->isValid()) { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository('ChillEventBundle:Status')->find($id); + $entity = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Status entity.'); @@ -79,7 +79,7 @@ class StatusController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository('ChillEventBundle:Status')->find($id); + $entity = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Status entity.'); @@ -102,7 +102,7 @@ class StatusController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entities = $em->getRepository('ChillEventBundle:Status')->findAll(); + $entities = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->findAll(); return $this->render('ChillEventBundle:Status:index.html.twig', [ 'entities' => $entities, @@ -132,7 +132,7 @@ class StatusController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository('ChillEventBundle:Status')->find($id); + $entity = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Status entity.'); @@ -155,7 +155,7 @@ class StatusController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository('ChillEventBundle:Status')->find($id); + $entity = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Status entity.'); diff --git a/src/Bundle/ChillEventBundle/Tests/Controller/ParticipationControllerTest.php b/src/Bundle/ChillEventBundle/Tests/Controller/ParticipationControllerTest.php index 87b3b0ebe..d81c6f9c8 100644 --- a/src/Bundle/ChillEventBundle/Tests/Controller/ParticipationControllerTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Controller/ParticipationControllerTest.php @@ -292,7 +292,7 @@ final class ParticipationControllerTest extends WebTestCase $this->assertGreaterThan(0, count($span2)); // as the container has reloaded, reload the event - $event = $this->em->getRepository('ChillEventBundle:Event')->find($event->getId()); + $event = $this->em->getRepository(\Chill\EventBundle\Entity\Event::class)->find($event->getId()); $this->em->refresh($event); $this->assertEquals($nbParticipations + 2, $event->getParticipations()->count()); @@ -388,7 +388,7 @@ final class ParticipationControllerTest extends WebTestCase $this->assertTrue($this->client->getResponse()->isRedirect()); // reload the event and test there is a new participation - $event = $this->em->getRepository('ChillEventBundle:Event') + $event = $this->em->getRepository(\Chill\EventBundle\Entity\Event::class) ->find($event->getId()); $this->em->refresh($event); @@ -439,7 +439,7 @@ final class ParticipationControllerTest extends WebTestCase $this->assertGreaterThan(0, count($span)); // as the container has reloaded, reload the event - $event = $this->em->getRepository('ChillEventBundle:Event')->find($event->getId()); + $event = $this->em->getRepository(\Chill\EventBundle\Entity\Event::class)->find($event->getId()); $this->em->refresh($event); $this->assertEquals($nbParticipations + 1, $event->getParticipations()->count()); @@ -463,7 +463,7 @@ final class ParticipationControllerTest extends WebTestCase }); $circle = $circles[0]; - $events = $this->em->getRepository('ChillEventBundle:Event') + $events = $this->em->getRepository(\Chill\EventBundle\Entity\Event::class) ->findBy(['center' => $center, 'circle' => $circle]); return $events[array_rand($events)]; diff --git a/src/Bundle/ChillEventBundle/Tests/Search/EventSearchTest.php b/src/Bundle/ChillEventBundle/Tests/Search/EventSearchTest.php index bb93196fa..f8565b5e8 100644 --- a/src/Bundle/ChillEventBundle/Tests/Search/EventSearchTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Search/EventSearchTest.php @@ -90,7 +90,7 @@ final class EventSearchTest extends WebTestCase ->findOneBy(['name' => 'Center A']); $this->eventType = $this->entityManager - ->getRepository('ChillEventBundle:EventType') + ->getRepository(\Chill\EventBundle\Entity\EventType::class) ->findAll()[0]; $this->createEvents();