upgraded dependencies
This commit is contained in:
20
vendor/symfony/http-foundation/JsonResponse.php
vendored
20
vendor/symfony/http-foundation/JsonResponse.php
vendored
@@ -67,9 +67,13 @@ class JsonResponse extends Response
|
||||
* @param array $headers An array of response headers
|
||||
*
|
||||
* @return static
|
||||
*
|
||||
* @deprecated since Symfony 5.1, use __construct() instead.
|
||||
*/
|
||||
public static function create($data = null, $status = 200, $headers = [])
|
||||
public static function create($data = null, int $status = 200, array $headers = [])
|
||||
{
|
||||
trigger_deprecation('symfony/http-foundation', '5.1', 'The "%s()" method is deprecated, use "new %s()" instead.', __METHOD__, static::class);
|
||||
|
||||
return new static($data, $status, $headers);
|
||||
}
|
||||
|
||||
@@ -87,7 +91,7 @@ class JsonResponse extends Response
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public static function fromJsonString($data, $status = 200, $headers = [])
|
||||
public static function fromJsonString(string $data, int $status = 200, array $headers = [])
|
||||
{
|
||||
return new static($data, $status, $headers, true);
|
||||
}
|
||||
@@ -101,7 +105,7 @@ class JsonResponse extends Response
|
||||
*
|
||||
* @throws \InvalidArgumentException When the callback name is not valid
|
||||
*/
|
||||
public function setCallback($callback = null)
|
||||
public function setCallback(string $callback = null)
|
||||
{
|
||||
if (null !== $callback) {
|
||||
// partially taken from https://geekality.net/2011/08/03/valid-javascript-identifier/
|
||||
@@ -130,11 +134,9 @@ class JsonResponse extends Response
|
||||
/**
|
||||
* Sets a raw string containing a JSON document to be sent.
|
||||
*
|
||||
* @param string $json
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setJson($json)
|
||||
public function setJson(string $json)
|
||||
{
|
||||
$this->data = $json;
|
||||
|
||||
@@ -185,13 +187,11 @@ class JsonResponse extends Response
|
||||
/**
|
||||
* Sets options used while encoding data to JSON.
|
||||
*
|
||||
* @param int $encodingOptions
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setEncodingOptions($encodingOptions)
|
||||
public function setEncodingOptions(int $encodingOptions)
|
||||
{
|
||||
$this->encodingOptions = (int) $encodingOptions;
|
||||
$this->encodingOptions = $encodingOptions;
|
||||
|
||||
return $this->setData(json_decode($this->data));
|
||||
}
|
||||
|
Reference in New Issue
Block a user