Skip to content

Commit

Permalink
Upgrade version to 2.0.1
Browse files Browse the repository at this point in the history
fixed
  • Loading branch information
64j committed Jan 23, 2023
1 parent 789b4ef commit 2cc666c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/ResponseFactoryAwareTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
*/
use Arus\Http\Response\Resource\Error;
use Arus\Http\Response\Resource\Errors;
use Laminas\Diactoros\Response\JsonResponse;
use Psr\Http\Message\ResponseInterface;
use Sunrise\Http\Message\Response\HtmlResponse;
use Sunrise\Http\Message\Response\JsonResponse;
use Sunrise\Http\Message\ResponseFactory;
use Symfony\Component\Validator\ConstraintViolationInterface;
use InvalidArgumentException;
Expand All @@ -35,6 +35,11 @@ trait ResponseFactoryAwareTrait
*/
protected $jsonOptions = 0;

/**
* @var int
*/
protected $jsonDepth = 512;

/**
* @param int $status
*
Expand All @@ -61,13 +66,12 @@ public function html($content, int $status = 200) : ResponseInterface
/**
* @param mixed $payload
* @param int $status
* @param array $headers
*
* @return ResponseInterface
*/
public function json($payload, int $status = 200, array $headers = []) : ResponseInterface
public function json($payload, int $status = 200) : ResponseInterface
{
return new JsonResponse($status, $payload, $headers, $this->jsonOptions);
return new JsonResponse($status, $payload, $this->jsonOptions, $this->jsonDepth);
}

/**
Expand Down

0 comments on commit 2cc666c

Please sign in to comment.