Skip to content

Commit

Permalink
[HttpFoundation] Fix SA/phpdoc JsonResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
ro0NL authored and fabpot committed Jun 16, 2019
1 parent cfbb5b5 commit 270f10c
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/Symfony/Component/HttpFoundation/JsonResponse.php
Expand Up @@ -55,10 +55,10 @@ public function __construct($data = null, $status = 200, $headers = [], $json =
*
* 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
*
Expand All @@ -70,7 +70,18 @@ public static function create($data = null, $status = 200, $headers = [])
}

/**
* 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 = [])
{
Expand Down

0 comments on commit 270f10c

Please sign in to comment.