Upgrade to 3.2.0
This commit is contained in:
@@ -7,6 +7,12 @@ use Kirby\Toolkit\Str;
|
||||
|
||||
/**
|
||||
* Global response configuration
|
||||
*
|
||||
* @package Kirby Cms
|
||||
* @author Bastian Allgeier <bastian@getkirby.com>
|
||||
* @link https://getkirby.com
|
||||
* @copyright Bastian Allgeier GmbH
|
||||
* @license https://getkirby.com/license
|
||||
*/
|
||||
class Responder
|
||||
{
|
||||
@@ -46,7 +52,7 @@ class Responder
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->send();
|
||||
return (string)$this->send();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,9 +91,8 @@ class Responder
|
||||
* Construct response from an array
|
||||
*
|
||||
* @param array $response
|
||||
* @return self
|
||||
*/
|
||||
public function fromArray(array $response)
|
||||
public function fromArray(array $response): void
|
||||
{
|
||||
$this->body($response['body'] ?? null);
|
||||
$this->code($response['code'] ?? null);
|
||||
@@ -137,7 +142,7 @@ class Responder
|
||||
* Shortcut to configure a json response
|
||||
*
|
||||
* @param array $json
|
||||
* @return self
|
||||
* @return string|self
|
||||
*/
|
||||
public function json(array $json = null)
|
||||
{
|
||||
@@ -169,7 +174,7 @@ class Responder
|
||||
* Creates and returns the response object from the config
|
||||
*
|
||||
* @param string|null $body
|
||||
* @return Response
|
||||
* @return Kirby\Cms\Response
|
||||
*/
|
||||
public function send(string $body = null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user