'error', 'key' => 'twig', 'method' => 'getTwigView', 'data' => '', ]; $token = $request->headers->get('x-auth-token'); $security->isGranted('MAESTRO_PROJECT_TEMPLATE_READ', $token); $variables = $query->getVariables($id); if (is_array($variables)) { $body['type'] = 'success'; $body['data'] = $variables; $respond->statusOk(); } else { $body['method'] = 'read'; $body['data'] = "No Twig found for id : $id !"; $respond->statusUnprocessableEntity(); } return $respond->createBody($body)->respond(); } }