'error', 'key' => 'template', 'method' => 'getLastJsx', 'data' => '', ]; $token = $request->headers->get('x-auth-token'); $security->isGranted('MAESTRO_PROJECT_TEMPLATE_READ', $token); $blobDedicatedFile = $query->getLastDedicatedFileByExtension($idTemplate, $extension); if (!\is_string($blobDedicatedFile)) { $type = \gettype($blobDedicatedFile); $body['data'] = "Expected string, $type received"; $respond->statusUnprocessableEntity(); } else { $body['type'] = 'success'; $body['data'] = $blobDedicatedFile; $respond->statusOk(); } return $respond->createBody($body)->respond(); } }