Skip to content

Commit 2cc666c

Browse files
committed
Upgrade version to 2.0.1
fixed
1 parent 789b4ef commit 2cc666c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/ResponseFactoryAwareTrait.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
*/
88
use Arus\Http\Response\Resource\Error;
99
use Arus\Http\Response\Resource\Errors;
10-
use Laminas\Diactoros\Response\JsonResponse;
1110
use Psr\Http\Message\ResponseInterface;
1211
use Sunrise\Http\Message\Response\HtmlResponse;
12+
use Sunrise\Http\Message\Response\JsonResponse;
1313
use Sunrise\Http\Message\ResponseFactory;
1414
use Symfony\Component\Validator\ConstraintViolationInterface;
1515
use InvalidArgumentException;
@@ -35,6 +35,11 @@ trait ResponseFactoryAwareTrait
3535
*/
3636
protected $jsonOptions = 0;
3737

38+
/**
39+
* @var int
40+
*/
41+
protected $jsonDepth = 512;
42+
3843
/**
3944
* @param int $status
4045
*
@@ -61,13 +66,12 @@ public function html($content, int $status = 200) : ResponseInterface
6166
/**
6267
* @param mixed $payload
6368
* @param int $status
64-
* @param array $headers
6569
*
6670
* @return ResponseInterface
6771
*/
68-
public function json($payload, int $status = 200, array $headers = []) : ResponseInterface
72+
public function json($payload, int $status = 200) : ResponseInterface
6973
{
70-
return new JsonResponse($status, $payload, $headers, $this->jsonOptions);
74+
return new JsonResponse($status, $payload, $this->jsonOptions, $this->jsonDepth);
7175
}
7276

7377
/**

0 commit comments

Comments
 (0)