1 | <?php |
||
17 | class QuoteController extends Controller |
||
18 | { |
||
19 | |||
20 | /** |
||
21 | * Get the tool's shortname. |
||
22 | * @return string |
||
23 | */ |
||
24 | public function getToolShortname() |
||
28 | |||
29 | /** |
||
30 | * Method for rendering the Bash Main Form. |
||
31 | * This method redirects if valid parameters are found, making it a |
||
32 | * valid form endpoint as well. |
||
33 | * |
||
34 | * @param \Symfony\Component\HttpFoundation\Request $request Given by Symfony |
||
35 | * |
||
36 | * @Route("/bash", name="bash") |
||
37 | * @Route("/quote", name="quote") |
||
38 | * |
||
39 | * @return \Symfony\Component\HttpFoundation\Response |
||
40 | */ |
||
41 | public function indexAction(Request $request) |
||
63 | |||
64 | /** |
||
65 | * Method for rendering a random quote. |
||
66 | * This should redirect to the /quote/{id} path below |
||
67 | * |
||
68 | * @Route("/quote/random", name="quoteRandom") |
||
69 | * @Route("/bash/random", name="bashRandom") |
||
70 | * |
||
71 | * @return \Symfony\Component\HttpFoundation\RedirectResponse |
||
72 | */ |
||
73 | public function randomQuoteAction() |
||
87 | |||
88 | /** |
||
89 | * Method to show all quotes. |
||
90 | * |
||
91 | * @Route("/quote/all", name="quoteAll") |
||
92 | * @Route("/bash/all", name="bashAll") |
||
93 | * |
||
94 | * @return \Symfony\Component\HttpFoundation\Response |
||
95 | */ |
||
96 | public function quoteAllAction() |
||
120 | |||
121 | /** |
||
122 | * Method to render a single quote. |
||
123 | * |
||
124 | * @param int $id ID of the quote |
||
125 | * |
||
126 | * @Route("/quote/{id}", name="quoteID") |
||
127 | * @Route("/bash/{id}", name="bashID") |
||
128 | * |
||
129 | * @return \Symfony\Component\HttpFoundation\Response |
||
130 | */ |
||
131 | public function quoteAction($id) |
||
167 | } |
||
168 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: