This check compares the return type specified in the @return annotation of a function
or method doc comment with the types returned by the function and raises an issue if they
mismatch.
Loading history...
31
*
32
* @Route("/hello/{name}", name="api_hello")
33
*/
34
public function serviceAction(string $name)
35
{
36
return new JsonResponse(['name' => $name, 'message' => sprintf('Hello %s!', $name)]);
This check compares the return type specified in the @return annotation of a function
or method doc comment with the types returned by the function and raises an issue if they
mismatch.
Loading history...
41
*
42
* @OAuth2(scope="profile openid")
43
* @Route("/hello-profile", name="api_scope")
44
*/
45
public function scopeProtectionAction()
46
{
47
return new JsonResponse(['name' => 'I am protected by scope', 'message' => 'Hello!']);
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.