Total Complexity | 5 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
10 | final class GreetingController extends Controller |
||
11 | { |
||
12 | /** |
||
13 | * @param string|null $name |
||
14 | * |
||
15 | * @return Response |
||
16 | */ |
||
17 | public function staticallyGreetAction(?string $name): Response |
||
18 | { |
||
19 | return $this->render('@AcmePHPDishExamplePlugin/static_greeting.html.twig', ['greeting' => $this->getGreeting($name)]); |
||
20 | } |
||
21 | |||
22 | /** |
||
23 | * @param string|null $name |
||
24 | * |
||
25 | * @return Response |
||
26 | */ |
||
27 | public function dynamicallyGreetAction(?string $name): Response |
||
28 | { |
||
29 | return $this->render('@AcmePHPDishExamplePlugin/dynamic_greeting.html.twig', ['greeting' => $this->getGreeting($name)]); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * @param string|null $name |
||
34 | * |
||
35 | * @return string |
||
36 | */ |
||
37 | private function getGreeting(?string $name): string |
||
46 | } |
||
47 | } |
||
48 | } |
||
49 |