Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 22 |
|
0.00% |
0 / 7 |
CRAP | |
0.00% |
0 / 1 |
TermineController | |
0.00% |
0 / 22 |
|
0.00% |
0 / 7 |
56 | |
0.00% |
0 / 1 |
termineList | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
termineDetail | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
terminLocationsList | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
terminLocationDetail | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
terminTemplatesList | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
terminTemplateDetail | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
termineICal | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace Olz\Controller; |
4 | |
5 | use Olz\Termine\Components\OlzICal\OlzICal; |
6 | use Olz\Termine\Components\OlzTerminDetail\OlzTerminDetail; |
7 | use Olz\Termine\Components\OlzTermineList\OlzTermineList; |
8 | use Olz\Termine\Components\OlzTerminLocationDetail\OlzTerminLocationDetail; |
9 | use Olz\Termine\Components\OlzTerminLocationsList\OlzTerminLocationsList; |
10 | use Olz\Termine\Components\OlzTerminTemplateDetail\OlzTerminTemplateDetail; |
11 | use Olz\Termine\Components\OlzTerminTemplatesList\OlzTerminTemplatesList; |
12 | use Olz\Utils\HttpUtils; |
13 | use Psr\Log\LoggerInterface; |
14 | use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; |
15 | use Symfony\Component\HttpFoundation\Request; |
16 | use Symfony\Component\HttpFoundation\Response; |
17 | use Symfony\Component\Routing\Annotation\Route; |
18 | |
19 | class TermineController extends AbstractController { |
20 | #[Route('/termine')] |
21 | public function termineList( |
22 | Request $request, |
23 | LoggerInterface $logger, |
24 | HttpUtils $httpUtils, |
25 | OlzTermineList $olzTermineList, |
26 | ): Response { |
27 | $httpUtils->countRequest($request, ['filter', 'von']); |
28 | $out = $olzTermineList->getHtml([]); |
29 | return new Response($out); |
30 | } |
31 | |
32 | #[Route('/termine/{id}', requirements: ['id' => '\d+'])] |
33 | public function termineDetail( |
34 | Request $request, |
35 | LoggerInterface $logger, |
36 | HttpUtils $httpUtils, |
37 | OlzTerminDetail $olzTerminDetail, |
38 | int $id, |
39 | ): Response { |
40 | $httpUtils->countRequest($request, ['von']); |
41 | $out = $olzTerminDetail->getHtml(['id' => $id]); |
42 | return new Response($out); |
43 | } |
44 | |
45 | #[Route('/termine/orte')] |
46 | public function terminLocationsList( |
47 | Request $request, |
48 | LoggerInterface $logger, |
49 | HttpUtils $httpUtils, |
50 | OlzTerminLocationsList $olzTerminLocationsList, |
51 | ): Response { |
52 | $httpUtils->countRequest($request); |
53 | $out = $olzTerminLocationsList->getHtml([]); |
54 | return new Response($out); |
55 | } |
56 | |
57 | #[Route('/termine/orte/{id}', requirements: ['id' => '\d+'])] |
58 | public function terminLocationDetail( |
59 | Request $request, |
60 | LoggerInterface $logger, |
61 | HttpUtils $httpUtils, |
62 | OlzTerminLocationDetail $olzTerminLocationDetail, |
63 | int $id, |
64 | ): Response { |
65 | $httpUtils->countRequest($request); |
66 | $out = $olzTerminLocationDetail->getHtml(['id' => $id]); |
67 | return new Response($out); |
68 | } |
69 | |
70 | #[Route('/termine/vorlagen')] |
71 | public function terminTemplatesList( |
72 | Request $request, |
73 | LoggerInterface $logger, |
74 | HttpUtils $httpUtils, |
75 | OlzTerminTemplatesList $olzTerminTemplatesList, |
76 | ): Response { |
77 | $httpUtils->countRequest($request); |
78 | $out = $olzTerminTemplatesList->getHtml([]); |
79 | return new Response($out); |
80 | } |
81 | |
82 | #[Route('/termine/vorlagen/{id}', requirements: ['id' => '\d+'])] |
83 | public function terminTemplateDetail( |
84 | Request $request, |
85 | LoggerInterface $logger, |
86 | HttpUtils $httpUtils, |
87 | OlzTerminTemplateDetail $olzTerminTemplateDetail, |
88 | int $id, |
89 | ): Response { |
90 | $httpUtils->countRequest($request); |
91 | $out = $olzTerminTemplateDetail->getHtml(['id' => $id]); |
92 | return new Response($out); |
93 | } |
94 | |
95 | #[Route('/olz_ical.ics')] |
96 | public function termineICal( |
97 | Request $request, |
98 | LoggerInterface $logger, |
99 | OlzICal $olzICal, |
100 | ): Response { |
101 | $out = $olzICal->getHtml([]); |
102 | $response = new Response($out); |
103 | $response->headers->set('Content-Type', 'text/calendar'); |
104 | return $response; |
105 | } |
106 | } |