'error', 'key' => 'version', 'method' => 'read', 'data' => '', ]; $token = $request->headers->get('x-auth-token'); $security->isGranted('MAESTRO_PROJECT_PROJECTS_READ', $token); $data = $query->read($id); if (!empty($data)) { $body['type'] = 'success'; $body['data'] = $data; $respond->statusOK(); } else { $body['data'] = 'version not found'; $respond->statusNotFound(); } return $respond->createBody($body)->respond(); } }