Skip to content

Commit

Permalink
Merge pull request #90 from WoltLab/json-response-flags
Browse files Browse the repository at this point in the history
Use constant expression for JsonResponse::DEFAULT_JSON_FLAGS
  • Loading branch information
Ocramius authored May 17, 2022
2 parents 099d60a + 21b5b73 commit d1bc565
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 d1bc565

Please sign in to comment.