response when generates standalone system report

@return JsonResponse
515911
public function generateStandalone(GeneratorListener $listener)
    {
        $response    = $this->consoleKernel->call('report:analyzer');
        $splFileInfo = new SplFileInfo($this->consoleKernel->output());
        return new JsonResponse(['redirect' => handles('antares::logger/generate/download/' . trim($splFileInfo->getFilename()))], 200);
    }
641743
public function load()
    {
        $node = $this->loadNode();
        $r = array();
        foreach ($node->getChildNodes() as $childnode) {
            $json = $childnode->getTreeNodeJSON();
            if ($json) {
                $r[] = $json;
            }
        }
        return new JsonResponse($r);
    }
370806
public function portletsAction()
    {
        $securityContext = $this->get('security.context');

        $data = [];
        foreach ($this->get('phlexible_dashboard.portlets')->all() as $portlet) {
            if ($portlet->hasRole() && !$securityContext->isGranted($portlet->getRole())) {
                continue;
            }

            $data[] = $portlet->toArray();
        }

        return new JsonResponse($data);
    }
174966
public function buildForceDownloadResponse()
    {
        $fre = $this->getFileResource();

        $fs = $this->getFile()->getFileStorageLocationObject()->getFileSystemObject();
        $response = new FlysystemFileResponse($fre->getPath(), $fs);

        $response->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT);

        return $response;
    }
96651
public function listJsonAction()
    {
        $em = $this->getDoctrine()->getManager();
        $adminManager = $this->get('admin_manager');
        /** @var \AdminBundle\Services\DataTables\JsonList $jsonList */
        $jsonList = $this->get('json_list');
        $jsonList->setRepository($em->getRepository('EcommerceBundle:Product'));
        $user = $this->container->get('security.token_storage')->getToken()->getUser();
        if ($user->isGranted('ROLE_USER')) {
            $jsonList->setActor($user);
        }
        
        $response = $jsonList->get();

        return new JsonResponse($response);
    }
4052
public function sendOutput()
    {
        // check environment to see what and how to do the output
        $prettyPrint = false;
        if ($this->env == 'development') {
            $prettyPrint = true;
            unset($this->outputArray['debug']);
        }

        // if there is an error, we always dump the content
        if (!empty($this->outputArray['errorReport'])) {
            unset($this->outputArray['data']);
        }

        // build response
        if (empty($this->outputArray)) {
            $response = $this->httpResponse();
        } else {
            $response = new JsonResponse($this->outputArray, $this->debugHeaders, $prettyPrint);
        }

        // set proper status code to the response
        $response->setStatusCode($this->statusCode, $this->message);

        // check the expires header
        if ($this->expiresIn > 0) {
            $expiration = $this->dateTime()->add('PT' . $this->expiresIn . 'S');
            $response->cacheControl()->setAsCache($expiration);
        }

        // send it to the browser
        $response->send();
    }
569889
public function query()
    {
        $sourceUUID = $this->getSourceUUID();
        if (empty($sourceUUID)) {
            return new JsonResponse([
                'status' => 'Error',
                'message' => 'Source UUID header must be defined',
            ], 400);
        }

        $authorUUID = $this
            ->userCredentialsProvider
            ->getUUID();

        $queryParameterBag = $this
            ->request
            ->query;

        $page = (int) $queryParameterBag->get('page', 1);
        $numPerPage = (int) $queryParameterBag->get('num_per_page', 10);
        $sortBy = json_decode($queryParameterBag->get(
            'sort_by',
            ['created_at' => 'desc']
        ), true);
        $indexedMetadataSortBy = [
            'indexed_metadata.' . key($sortBy) => $sortBy[key($sortBy)],
        ];

        $role = $this->userCredentialsProvider->isModerator()
            ? Author::ROLE_MODERATOR
            : Author::ROLE_USER;

        $result = $this
            ->commentRepository
            ->getCommentsBySource(
                $sourceUUID,
                $page,
                $numPerPage,
                $indexedMetadataSortBy,
                $role
            );

        if (!empty($authorUUID)) {
            foreach ($result->getComments() as $comment) {
                $this->setEditableInComment(
                    $comment,
                    $authorUUID
                );
            }
        }
        
        return new JsonResponse([
            'comments_result' => $result->toArray(),
            'user' => $this->userCredentialsProvider->toArray(),
        ], 200);
    }
961449
public function checkVhostSetupAction()
    {
        $success = 0;
        $errors = [];

        if ($this->getRequest()->isXmlHttpRequest()) {
            $response = $this->vHostSetupChecker();
            $success = $response['success'];
            $errors = $response['errors'];

            // add status to session
            $container = new Container('melisinstaller');
            $container['steps'][$this->steps[1]] = ['page' => 2, 'success' => $success];
        }

        return new JsonModel([
            'success' => $success,
            'errors' => $errors,
        ]);
    }
812574
public function index()
    {
        try {            
            $files = $this->file->get(Input::get('pid'));
            
            return response()->json([
                'status' => 'success',
                'data' => $files,
            ]);
        }
        
        catch (Exception $e) {
            return $this->handleError($e);
        }
    }
652213
public function getProcessedResponse()
    {
        $_documentClass = $this->_documentClass;
        $_edgeClass = $this->_edgeClass;

        $response = $this->getResponse();
        switch ($this->_type) {
            case 'first':
                $json             = $response->getJson();
                if (!isset($json['error']) || $json['error'] === false) {
                    $options           = $this->getCursorOptions();
                    $options['_isNew'] = false;
                    $response          = $_documentClass::createFromArray($json['document'], $options);
                } else {
                    $response          = false;
                }
                break;
            case 'getdocument':
                $json              = $response->getJson();
                $options           = $this->getCursorOptions();
                $options['_isNew'] = false;
                $response          = $_documentClass::createFromArray($json, $options);
                break;
            case 'document':
                $json = $response->getJson();
                if (!isset($json['error']) || $json['error'] === false) {
                    $id       = $json[$_documentClass::ENTRY_ID];
                    $response = $id;
                }
                break;
            case 'getedge':
                $json              = $response->getJson();
                $options           = $this->getCursorOptions();
                $options['_isNew'] = false;
                $response          = $_edgeClass::createFromArray($json, $options);
                break;
            case 'edge':
                $json = $response->getJson();
                if (!isset($json['error']) || $json['error'] === false) {
                    $id       = $json[Edge::ENTRY_ID];
                    $response = $id;
                }
                break;
            case 'getedges':
                $json              = $response->getJson();
                $options           = $this->getCursorOptions();
                $options['_isNew'] = false;
                $response          = [];
                foreach ($json[EdgeHandler::ENTRY_EDGES] as $data) {
                    $response[] = $_edgeClass::createFromArray($data, $options);
                }
                break;
            case 'getcollection':
                $json     = $response->getJson();
                $response = Collection::createFromArray($json);
                break;
            case 'collection':
                $json = $response->getJson();
                if (!isset($json['error']) || $json['error'] === false) {
                    $id       = $json[Collection::ENTRY_ID];
                    $response = $id;
                }
                break;
            case 'cursor':
            case 'all':
            case 'by':
                $options          = $this->getCursorOptions();
                $options['isNew'] = false;

                $options  = array_merge(['_documentClass' => $this->_documentClass], $options);
                $response = new Cursor($this->_batch->getConnection(), $response->getJson(), $options);
                break;
            case 'remove':
                $json     = $response->getJson();
                $response = [
                    'removed' => $json['removed'],
                    'ignored' => $json['ignored']
                ];
                break;
                
            default:
                throw new ClientException('Could not determine response data type.');
                break;
        }

        return $response;
    }
501327
public function indexAction()
    {
        $rootPath = str_replace('web/../', '', ROOT_PATH);

        $filepath = $rootPath . '/../../composer/installed.json';

        if (!file_exists($filepath)) {
            $filepath = $rootPath . '/vendor/composer/installed.json';
        }

        $installedJson = file_get_contents($filepath);

        $jsonDecoder = new JsonDecode(true);
        $installedArr = $jsonDecoder->decode($installedJson, JsonEncoder::FORMAT);

        $syrupComponents = array();
        foreach ($installedArr as $package) {
            $nameArr = explode("/", $package['name']);

            if ($nameArr[0] == 'syrup' || $nameArr[0] == 'keboola') {
                $syrupComponents[$package['name']] = $package['version'];
            }
        }

        return new JsonResponse(array(
            "host"          => gethostname(),
            "components"    => $syrupComponents,
            "documentation" => "http://documentation.keboola.com/syrup"
        ));
    }
595809
public function jsonSerialize()
    {
        $response = [];
        $response['displayMenu'] = $this->collection->displayMenu();
        $response['entries'] = [];
        $response['entryGroups'] = [];
        foreach ($this->collection->getEntries() as $entry) {
            $formatter = new EntryJsonFormatter($entry);
            $response['entries'][] = $formatter->jsonSerialize();
        }
        foreach ($this->collection->getEntryGroups() as $group) {
            $formatter = new GroupJsonFormatter($group);
            $response['entryGroups'][] = $formatter->jsonSerialize();
        }

        return $response;
    }
820299
public function actionCanEdit(): Response
    {
        $this->requireAcceptsJson();
        $this->requirePostRequest();

        $assetId = Craft::$app->getRequest()->getRequiredBodyParam('assetId');
        $asset = Asset::find()->id($assetId)->one();

        if (!$asset) {
            return $this->asJson([
                'success' => false
            ]);
        }

        /** @var Volume $volume */
        $volume = $asset->getVolume();
        $user = Craft::$app->getUser()->getIdentity();

        return $this->asJson([
            'success' => (
                $user->can('saveAssetInVolume:' . $volume->uid) &&
                $user->can('deleteFilesAndFoldersInVolume:' . $volume->uid)
            ),
        ]);
    }
1088350
public function js()
    {
        $renderer = $this->debugbar->getJavascriptRenderer();

        $content = $renderer->dumpAssetsToString('js');

        $response = new Response(
            $content, 200, [
                'Content-Type' => 'text/javascript',
            ]
        );

        return $this->cacheResponse($response);
    }
665704
protected function jsonResponse($json = null)
    {
        if (!$json) {
            $json = $this->file instanceof Folder ? $this->parent->createFolderJson($this->file)
                : $this->parent->createFileJson($this->file);
        }

        $response = new SS_HTTPResponse(
            Convert::array2json($json), 200
        );

        return $response->addHeader('Content-Type', 'application/json');
    }
973060
public function allAction()
    {
        $repository = $this->container->get('request')->get('repository');
        $response = new JsonResponse();

        if (!$this->isValidRepositoryName($repository)) {
            $response->setData(array('msg' => 'Package not found. Please check the package name. eg. (symfony/symfony)'));
            $response->setStatusCode(404);

            return $response;
        }

        try {
            $badges = $this->container->get('snippet_generator')->generateAllSnippets($repository);
            $response->setData($badges);
        } catch (ClientErrorResponseException $e) {
            $response->setData(array('msg' => 'Package not found. Please check the package name. eg. (symfony/symfony)'));
            $response->setStatusCode(404);
        } catch (\Exception $e) {
            $response->setData(array('msg' => 'Server Error'));
            $response->setStatusCode(500);
        }

        return $response;
    }
789781
public function generateResponse(){
        // Create request
        $this->startTimeline("request.create");

        $request    = $this->container->get("app.request")
            ->withAttribute("app.debug", $this->debug)
        ;

        $this->endTimeline("request.create");

        // Create response
        $this->startTimeline("response.create");

        $response   = $this->container->newInstance(Response::class, [
            "handler"   => $this->generateHandler($request),
        ]);

        $this->endTimeline("response.create");

        return $response;
    }