@param mixed[] $data

@return ResponseInterface
494833
private function step6Install(array $data): ResponseInterface
    {
        $error = $this->checkAdminUser($data['wtname'], $data['wtuser'], $data['wtpass'], $data['wtemail']);

        if ($error !== '') {
            $data['errors']->push($error);

            return $this->step5Administrator($data);
        }

        try {
            $this->createConfigFile($data);
        } catch (Throwable $exception) {
            return $this->viewResponse('setup/step-6-failed', ['exception' => $exception]);
        }

        // Done - start using webtrees!
        return redirect(route('admin-trees'));
    }
644123
public function execute(array $data): JsonResponse
    {
        $this->debug('link_shared', ['event' => $data]);

        /** @var UnfurlEvent $event */
        $event = $this->dispatcher->dispatch(Events::SLACK_UNFURL, new UnfurlEvent($data));
        $unfurls = $event->getUnfurls();

        $this->debug('unfurls', ['channel' => $data['channel'], 'ts' => $data['message_ts'], 'unfurls' => $unfurls]);
        if ($unfurls) {
            $this->slackClient->unfurl($data['channel'], $data['message_ts'], $unfurls);
        }

        return new JsonResponse([]);
    }
346816
public function respond(array $data = [], array $headers = []): JsonResponse
    {
        $meta = [
            'meta' => [
                'server_time' => time(),
                'server_timezone' => date_default_timezone_get(),
                'api_version' => 'v1',
            ],
        ];

        return response()->json(array_merge($data, $meta), $this->getStatusCode(), $headers);
    }
467577
public function sendData($data)
    {
        $httpResponse = $this->sendRequest($this->getEndpointAction(), null, 'GET');
        $responseData = json_decode($httpResponse->getBody(true), true);

        return $this->response = new HostedPurchaseResponse($this, $responseData);
    }
335001
public function sendData($data)
    {
        $response = $this->gocardless->events()->get($this->getEventId());

        return $this->response = new EventResponse($this, $response);
    }
1109306
public function sendData($data)
    {
        $httpResponse = $this->sendRequest('GET', '/gateways', json_encode($data));

        $this->response = new RestFetchPaymentMethodsResponse(
            $this,
            json_decode($httpResponse->getBody()->getContents(), true)
        );

        return $this->response;
    }
1017242
public function respondWithSuccess(array $data = []): JsonResponse
    {
        return $this->setStatusCode(IlluminateResponse::HTTP_OK)->respond([
            'status' => [
                'http_code' => $this->getStatusCode(),
            ],
            'data' => $data,
        ]);
    }
940958
public function create($data = [])
    {
        if (! $data) {
            $data = $this->data;
        } else {
            $this->populate($data);
        }

        $response = $this->client->post('', [], $data);

        if (!$response->hasErrors()) {
            $this->event->dispatch('SUBSCRIPTION.UPDATE', new SubscriptionsEvent($this->data));
        }

        return $this;
    }
263010
public function sendData($data)
    {
        $data = parent::sendData($data);

        return $this->response = new AopTransferToAccountQueryResponse($this, $data);
    }
371688
public function unserialize($data) //@codingStandardsIgnoreLine Interface does not define type-hints or return
    {
        $this->ensure(is_array($data), '$data was not an array');
        return new Response(
            Arrays::get($data, 'statusCode'),
            Arrays::get($data, 'headers'),
            Arrays::get($data, 'body'),
            Arrays::get($data, 'protocolVersion'),
            Arrays::get($data, 'reasonPhrase')
        );
    }
1338593
public function sendData($data): ResponseInterface
    {
        try {
            $requestBody = http_build_query($data);

            $httpResponse = $this->httpClient->post(
                $this->getEndpoint(),
                [
                    'Accept' => 'application/json',
                    'Content-type' => 'application/x-www-form-urlencoded',
                ],
                $requestBody
            )->send();

            $responseBody = (string) $httpResponse->getBody();
            $response = json_decode($responseBody, true) ?? [];

            return new AuthenticateResponse($this, $response);
        } catch (\Exception $e) {
            throw new InvalidResponseException(sprintf(
                'Error communicating with payment gateway: %s',
                $e->getMessage()
            ));
        }
    }
970577
private function response($data)
    {
        // @codeCoverageIgnoreStart
        if (!Yii::$app instanceof \yii\console\Application) {
            \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
        }
        // @codeCoverageIgnoreEnd
        return $data;
    }
333905
public function found(array $data): Response
    {
        $this->response->setBody(json_encode(['data' => $data]));
        return $this->response;
    }
304551
public static function CreateFromResponse(Array $data)
    {
        $id = $data["id"];
        $name = $data["name"];
        $price = $data["price"];

        $product = new Product($name, $price, $id);

        return $product;
    }
291097
public function create(array $data): PodiumResponse
    {
        /* @var $groupForm ModelFormInterface */
        $groupForm = $this->getForm();

        if (!$groupForm->loadData($data)) {
            return PodiumResponse::error();
        }

        return $groupForm->create();
    }
1251789
public function json(array $data)
    {
        $data = json_encode($data);
        $response = $this->withHeader('Content-Type', 'application/json');
        $response->getBody()->write($data);

        return $response;
    }
462468
private function jsonResponse($data)
    {
        $response = new Response(json_encode($data));
        $response->headers->set('Content-Type', 'application/json');
        return $response;
    }