bug #32057 [HttpFoundation] Fix SA/phpdoc JsonResponse (ro0NL)

This PR was squashed before being merged into the 3.4 branch (closes #32057).

Discussion
----------

[HttpFoundation] Fix SA/phpdoc JsonResponse

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Commits
-------

270f10cc81 [HttpFoundation] Fix SA/phpdoc JsonResponse
This commit is contained in:
Fabien Potencier 2019-06-16 13:18:13 +02:00
commit a8520ae605

View File

@ -55,10 +55,10 @@ class JsonResponse extends Response
*
* Example:
*
* return JsonResponse::create($data, 200)
* return JsonResponse::create(['key' => 'value'])
* ->setSharedMaxAge(300);
*
* @param mixed $data The json response data
* @param mixed $data The JSON response data
* @param int $status The response status code
* @param array $headers An array of response headers
*
@ -70,7 +70,18 @@ class JsonResponse extends Response
}
/**
* Make easier the creation of JsonResponse from raw json.
* Factory method for chainability.
*
* Example:
*
* return JsonResponse::fromJsonString('{"key": "value"}')
* ->setSharedMaxAge(300);
*
* @param string|null $data The JSON response string
* @param int $status The response status code
* @param array $headers An array of response headers
*
* @return static
*/
public static function fromJsonString($data = null, $status = 200, $headers = [])
{