Skip to content

Commit

Permalink
Use constant expression for JsonResponse::DEFAULT_JSON_FLAGS
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Düsterhus <duesterhus@woltlab.com>
  • Loading branch information
TimWolla committed May 17, 2022
1 parent 099d60a commit 21b5b73
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/Response/JsonResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
use function sprintf;

use const JSON_ERROR_NONE;
use const JSON_HEX_AMP;
use const JSON_HEX_APOS;
use const JSON_HEX_QUOT;
use const JSON_HEX_TAG;
use const JSON_UNESCAPED_SLASHES;

/**
* JSON response.
Expand All @@ -29,15 +34,15 @@ class JsonResponse extends Response
use InjectContentTypeTrait;

/**
* Default flags for json_encode; value of:
*
* <code>
* JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_UNESCAPED_SLASHES
* </code>
* Default flags for json_encode
*
* @const int
*/
public const DEFAULT_JSON_FLAGS = 79;
public const DEFAULT_JSON_FLAGS = JSON_HEX_TAG
| JSON_HEX_APOS
| JSON_HEX_AMP
| JSON_HEX_QUOT
| JSON_UNESCAPED_SLASHES;

/**
* @var mixed
Expand Down

0 comments on commit 21b5b73

Please # to comment.