Skip to content

Commit 8e12a4e

Browse files
committed
hotfix
1 parent a81bb3f commit 8e12a4e

File tree

3 files changed

+17
-26
lines changed

3 files changed

+17
-26
lines changed

lib/controller/groepen/AbstractGroepenController.php

+16-15
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
use Symfony\Component\Routing\RouteCollection;
6464
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
6565
use Symfony\Component\Serializer\SerializerInterface;
66+
use Twig\Environment;
6667

6768
/**
6869
* Algemene controller voor groepen.
@@ -82,13 +83,13 @@ abstract class AbstractGroepenController extends AbstractController implements
8283
/** @var GroepLidRepository */
8384
private $groepLidRepository;
8485

85-
public function __construct(ManagerRegistry $registry)
86+
public function __construct(protected ManagerRegistry $registry, private Environment $twig)
8687
{
87-
$this->repository = $registry->getRepository($this->getGroepType());
88-
$this->changeLogRepository = $registry->getRepository(
88+
$this->repository = $this->registry->getRepository($this->getGroepType());
89+
$this->changeLogRepository = $this->registry->getRepository(
8990
ChangeLogEntry::class
9091
);
91-
$this->groepLidRepository = $registry->getRepository(GroepLid::class);
92+
$this->groepLidRepository = $this->registry->getRepository(GroepLid::class);
9293
}
9394

9495
/**
@@ -231,7 +232,7 @@ public function overzicht(Request $request, $soort = null)
231232
);
232233
// controleert rechten bekijken per groep
233234
$body = new GroepenView(
234-
$this->container->get('csr.hack.twig'),
235+
$this->twig,
235236
$this->repository,
236237
$groepen,
237238
$soortEnum,
@@ -259,7 +260,7 @@ public function bekijken($id)
259260
}
260261
// controleert rechten bekijken per groep
261262
$body = new GroepenView(
262-
$this->container->get('csr.hack.twig'),
263+
$this->twig,
263264
$this->repository,
264265
$groepen,
265266
$soort,
@@ -310,7 +311,7 @@ public function pasfotos($id)
310311
if (!$this->isGranted(AbstractGroepVoter::BEKIJKEN, $groep)) {
311312
throw $this->createAccessDeniedException();
312313
}
313-
return new GroepPasfotosView($this->container->get('csr.hack.twig'), $groep);
314+
return new GroepPasfotosView($this->twig, $groep);
314315
}
315316

316317
public function lijst($id)
@@ -319,7 +320,7 @@ public function lijst($id)
319320
if (!$this->isGranted(AbstractGroepVoter::BEKIJKEN, $groep)) {
320321
throw $this->createAccessDeniedException();
321322
}
322-
return new GroepLijstView($this->container->get('csr.hack.twig'), $groep);
323+
return new GroepLijstView($this->twig, $groep);
323324
}
324325

325326
public function stats($id)
@@ -332,7 +333,7 @@ public function stats($id)
332333
$statistieken = $this->repository->getStatistieken($groep);
333334

334335
return new GroepStatistiekView(
335-
$this->container->get('csr.hack.twig'),
336+
$this->twig,
336337
$groep,
337338
$statistieken
338339
);
@@ -344,7 +345,7 @@ public function emails($id)
344345
if (!$this->isGranted(AbstractGroepVoter::BEKIJKEN, $groep)) {
345346
throw $this->createAccessDeniedException();
346347
}
347-
return new GroepEmailsView($this->container->get('csr.hack.twig'), $groep);
348+
return new GroepEmailsView($this->twig, $groep);
348349
}
349350

350351
public function eetwens($id)
@@ -353,7 +354,7 @@ public function eetwens($id)
353354
if (!$this->isGranted(AbstractGroepVoter::BEKIJKEN, $groep)) {
354355
throw $this->createAccessDeniedException();
355356
}
356-
return new GroepEetwensView($this->container->get('csr.hack.twig'), $groep);
357+
return new GroepEetwensView($this->twig, $groep);
357358
}
358359

359360
public function zoeken(Request $request, $zoekterm = null)
@@ -503,7 +504,7 @@ public function aanmaken(Request $request, $id = null, $soort = null)
503504
FlashType::SUCCESS,
504505
$groep::class . ' succesvol aangemaakt!'
505506
);
506-
$form = new GroepPreviewForm($this->container->get('csr.hack.twig'), $groep);
507+
$form = new GroepPreviewForm($this->twig, $groep);
507508
$view->modal = $form->__toString();
508509
return $view;
509510
} else {
@@ -743,7 +744,7 @@ public function voorbeeld($id)
743744
if (!$this->isGranted(AbstractGroepVoter::BEKIJKEN, $groep)) {
744745
throw $this->createAccessDeniedException();
745746
}
746-
return new GroepPreviewForm($this->container->get('csr.hack.twig'), $groep);
747+
return new GroepPreviewForm($this->twig, $groep);
747748
}
748749

749750
/**
@@ -851,7 +852,7 @@ public function ketzer_aanmelden(EntityManagerInterface $em, $id)
851852
$em->persist($lid);
852853
$em->flush();
853854
$groep->getLeden()->add($lid);
854-
return new GroepPasfotosView($this->container->get('csr.hack.twig'), $groep);
855+
return new GroepPasfotosView($this->twig, $groep);
855856
} else {
856857
return $form;
857858
}
@@ -980,7 +981,7 @@ public function ketzer_afmelden(EntityManagerInterface $em, $id, $uid = null)
980981
$em->remove($lid);
981982
$em->flush();
982983

983-
return new GroepView($this->container->get('csr.hack.twig'), $groep);
984+
return new GroepView($this->twig, $groep);
984985
}
985986

986987
public function afmelden(EntityManagerInterface $em, $id, $uid)

lib/controller/groepen/KetzersController.php

-10
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,6 @@
2020
*/
2121
class KetzersController extends AbstractGroepenController
2222
{
23-
/**
24-
* @var ManagerRegistry
25-
*/
26-
private $registry;
27-
28-
public function __construct(ManagerRegistry $registry)
29-
{
30-
parent::__construct($registry);
31-
$this->registry = $registry;
32-
}
3323

3424
public function getGroepType()
3525
{

lib/view/cms/CmsPaginaView.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function getTitel()
4343
public function __toString(): string
4444
{
4545
return (string) ContainerFacade::getContainer()
46-
->get(Environment::class)
46+
->get('csr.hack.twig')
4747
->render('cms/pagina-inhoud.html.twig', [
4848
'pagina' => $this->pagina,
4949
]);

0 commit comments

Comments
 (0)