for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Spatie\Fractal;
class Response
{
/** @var int */
protected $statusCode = 200;
/** @var array */
protected $headers = [];
/**
* Get the status code.
*
* @return int
*/
public function statusCode()
return $this->statusCode;
}
* Set the status code.
* @param int $statusCode
* @return self
public function code($statusCode)
$this->statusCode = $statusCode;
return $this;
* Return HTTP headers.
* @return array
public function getHeaders()
return $this->headers;
* Set one HTTP header.
* @param string $key
* @param string $value
public function header($key, $value)
$this->headers[$key] = $value;
* Set multiple headers at once.
* @param array $headers
public function headers($headers)
foreach ($headers as $key => $value) {
$this->header($key, $value);