Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"psr/http-factory": "^1.0",
"psr/http-message": "^1.0|^2.0",
"psr/log": "^3.0.0",
"rector/rector": "2.3.1",
"rector/rector": "2.3.8",
"symfony/cache": "^7.3",
"symfony/filesystem": "^7.3",
"symfony/mailer": "^7.2.6",
Expand Down Expand Up @@ -75,7 +75,7 @@
"patrickbussmann/oauth2-apple": "^0.3",
"phpat/phpat": "^0.11.0",
"phpbench/phpbench": "^1.4",
"phpstan/phpstan": "2.1.33",
"phpstan/phpstan": "2.1.40",
"phpunit/phpunit": "^12.5.8",
"predis/predis": "^3.0.0",
"riskio/oauth2-auth0": "^2.4",
Expand Down
7 changes: 7 additions & 0 deletions packages/validation/src/Rules/IsJsonString.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

use Attribute;
use Tempest\Validation\Rule;
use ValueError;

use const JSON_INVALID_UTF8_IGNORE;

/**
* Validates that the value is a valid JSON string.
Expand All @@ -31,6 +34,10 @@ public function isValid(mixed $value): bool
}

if ($this->flags !== null) {
if ($this->flags !== JSON_INVALID_UTF8_IGNORE) {
throw new ValueError('Invalid JSON validation flags provided.');
}

$arguments['flags'] = $this->flags;
}

Expand Down
Loading