Define o corpo da resposta

@param Mixed $data Dados para resposta em tela
@throws \RuntimeException
167566
private function setData($data)
	{
		// Não exibir somente strings
		if (is_string($data)) {
			$data = [$data];
		}
		// Setar o JSON
		$body = $this->getBody();
		$body->rewind();
		$json = json_encode($data);
		if (config('system.debug', false)) {
			$json = jsonpp( str_replace(['\n','\\\\','\t'],["\n",'\\',"\t"], $json ) );
		}
		$body->write($json);
		// Ensure that the json encoding passed successfully
		if ($json === false) {
			throw new \RuntimeException(json_last_error_msg(), json_last_error());
		}
	}
1133823
public function save($data): void
    {
        $filepath = $this->filepath;
        $dir = $this->getPath();

        if (!$this->mkdir($dir)) {
            throw new \RuntimeException('Creating directory failed for ' . $filepath);
        }

        try {
            if ($this->handle) {
                $tmp = true;
                // As we are using non-truncating locking, make sure that the file is empty before writing.
                if (@ftruncate($this->handle, 0) === false || @fwrite($this->handle, $data) === false) {
                    // Writing file failed, throw an error.
                    $tmp = false;
                }
            } else {
                // Create file with a temporary name and rename it to make the save action atomic.
                $tmp = $this->tempname($filepath);
                if (@file_put_contents($tmp, $data) === false) {
                    $tmp = false;
                } elseif (@rename($tmp, $filepath) === false) {
                    @unlink($tmp);
                    $tmp = false;
                }
            }
        } catch (\Exception $e) {
            $tmp = false;
        }

        if ($tmp === false) {
            throw new \RuntimeException('Failed to save file ' . $filepath);
        }

        // Touch the directory as well, thus marking it modified.
        @touch($dir);
    }
577322
public function postRaw($data)
    {
        $this->content = $data;
        $url = $this->url;
        if (!empty($this->replaceParams)) {
            $url = self::buildUri($url, $this->replaceParams);
        }
        $this->adapter->setResponseTimeout($this->getResponseTimeout());
        $this->adapter->setConnectTimeout($this->getConnectTimeout());

        return $this->adapter->post(
            $url,
            array(
                self::HEADERS => $this->headers,
                self::CONTENT => $this->content,
            )
        );
    }
606248
public function sendData($data)
    {
        $response = $this->gocardless->mandates()->reinstate($this->getMandateReference());

        return $this->response = new MandateResponse($this, $response);
    }
1337727
public function sendData($data)
    {
        if ($this->sendData === null) {
            $this->sendData = $this->getData();
        }

        $data = $this->createSOAPEnvelope(
            $this->prepareParameters(
                $this->sendData
            )
        );

        $headers = array(
            'Content-Type' => 'text/xml; charset=utf-8',
            'SOAPAction' => $this->method
        );

        $httpResponse = $this->httpClient->post(
            $this->getEndpoint(),
            $headers,
            $data
        )->send();

        return $this->response = new Response($this, $httpResponse->getBody());
    }
38564
protected function setBody($data)
    {
        $this->responseWriter->setBody($this->response, $data, $this->request);
    }
1065862
public function setContents(array $data)
	{
		if ($this->readOnly)
		{
			throw new \RuntimeException('Changing values on this Data Container is not allowed.');
		}

		$this->data = $data;

		$this->isModified = true;

		return $this;
	}
168304
public function decode(string $data): array
    {
        $rawData = [];
        parse_str($data, $rawData);

        if ('' !== $data && [] === $rawData) {
            throw DeserializerRuntimeException::createNotParsable($this->getContentType());
        }

        return $this->fixValues($rawData);
    }
77817
public function setData($data)
    {
        $this->originalData = $data;

        if ($data instanceof \Iterator) {
            $this->iterator = $data;
        }
        elseif (is_array($data)) {
            $this->iterator = new \ArrayIterator($data);
        }
        else {
            $this->iterator = new \ArrayIterator(array($data));
        }
    }
82396
public function gerarCampoLivre(ArrayObject $data)
    {
        $this->alterarTamanho('NossoNumero', 7);
        $this->alterarTamanho('Carteira', 1);
        $this->alterarTamanho('Modalidade', 2);
        $this->alterarTamanho('Conta', 7);
        $this->alterarTamanho('Parcela', 3);
        $this->alterarTamanho('Modalidade', 2);

        $this->layout = ':Banco:Moeda:FatorVencimento:Valor:Carteira:Agencia:Modalidade:Conta:NossoNumero:Parcela';

        return $data;
    }
696354
public function updateFromFormData($data)
    {
        $cmsFields = $this->getCMSFields();

        foreach ($data as $field => $datum) {
            $field = $cmsFields->dataFieldByName($field);

            if (!$field) {
                continue;
            }

            $field->setSubmittedValue($datum);
            $field->saveInto($this);
        }
    }
4960
public function printLine($data)
    {
        if (!is_array($data)) {
            throw new \RuntimeException("can not write CSV data. supplied data is not an array.");
        }
        fputcsv($this->handle, $data, $this->delimiter, $this->enclosure, $this->escape);
        ++$this->lineNumber;
    }
600856
public function populate(\stdClass $data)
    {
        $this->CodEmpresa = $data->codEmpresa;
        $this->NumCnpj = $data->numCnpj;
        $this->RazaoSocial = $data->razaoSocial;
        $this->NomFantasia = $data->nomFantasia;
        $this->NumInscricaoEstadual = (isset($data->numInscricaoEstadual)) ? $data->numInscricaoEstadual : null;
        $this->NumInscricaoMunicipal = (isset($data->numInscricaoMunicipal)) ? $data->numInscricaoMunicipal : null;
        $this->NomLogradouro = (isset($data->nomLogradouro)) ? $data->nomLogradouro : null;
        $this->NumLogradouro = (isset($data->numLogradouro)) ? $data->numLogradouro : null;
        $this->DscComplemento = (isset($data->dscComplemento)) ? $data->dscComplemento : null;
        $this->NomBairro = (isset($data->nomBairro)) ? $data->nomBairro : null;
        $this->NomLocalidade = (isset($data->nomLocalidade)) ? $data->nomLocalidade : null;
        $this->SglPais = (isset($data->sglPais)) ? $data->sglPais : null;
        $this->SglUF = (isset($data->sglUf)) ? $data->sglUf : null;
        $this->NumCep = (isset($data->numCep)) ? $data->numCep : null;
        $this->NumDDD = (isset($data->numDdd)) ? $data->numDdd : null;
        $this->NumTelefone = (isset($data->numTelefone)) ? $data->numTelefone : null;
        $this->DscEmail = (isset($data->dscEmail)) ? $data->dscEmail : null;

        if (isset($data->dadosBancarios)) {
            $this->DadosBancarios = new Banco(
                $data->dadosBancarios->nomFavorecido,
                $data->dadosBancarios->numCpfCnpjFavorecido,
                $data->dadosBancarios->numBanco,
                $data->dadosBancarios->numAgencia,
                $data->dadosBancarios->numContaCorrente,
                $data->dadosBancarios->numDigitoContaCorrente
            );
        }
    }
64039
public function setData($data)
    {
        if ($data instanceof Collection || $data instanceof Model) {
            $this->data = $data->toArray();
        } elseif (is_array($data) || $data instanceof Repository) {
            $this->data = $data;
        } else {
            throw new \InvalidArgumentException('Data must be an array, a Collection, a Model or a Repository');
        }
    }
214515
protected function _write($data) {
		if (!$this->connected) {
			$message = 'No connecting found while writing data to socket.';
			throw new RuntimeException($message);
		}

		$data .= "\r\n";
		return fwrite($this->_connection, $data, strlen($data));
	}
608083
public function initDataInterface(string $data):QRDataInterface{

		foreach(['Number', 'AlphaNum', 'Kanji', 'Byte'] as $mode){
			$dataInterface = __NAMESPACE__.'\\Data\\'.$mode;

			if(\call_user_func_array([$this, 'is'.$mode], [$data]) && \class_exists($dataInterface)){
				return new $dataInterface($this->options, $data);
			}

		}

		throw new QRCodeDataException('invalid data type'); // @codeCoverageIgnore
	}
1100029
private function writeData($data) {
        $count = fwrite($this->connection, $data.EOL_WINDOWS, strlen($data)+2);

        if ($count != strlen($data)+2)
            throw new RuntimeException('Error writing to socket, length of data: '.(strlen($data)+2).', bytes written: '.$count.NL.'data: '.$data.NL.NL.'SMTP transfer log:'.NL.'------------------'.NL.$this->logBuffer);

        $this->logSentData($data);
    }