'error', 'key' => 'template', 'method' => 'list', 'data' => '', ]; $token = $request->headers->get('x-auth-token'); $security->isGranted('MAESTRO_PROJECT_TEMPLATE_LIST', $token); $list = $query->list(); if (!\is_array($list)) { $type = \gettype($list); $body['data'] = "Expected array, $type received"; $respond->statusUnprocessableEntity(); } else { $body['type'] = 'success'; $body['data'] = $list; $respond->statusOk(); } return $respond->createBody($body)->respond(); } }