Skip to content

Commit

Permalink
Sync implementation with http-structured-field package update
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Nov 18, 2024
1 parent 1da6802 commit 6153565
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Properties.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ public static function validator(): ParametersValidator

$validator = ParametersValidator::new()
->filterByCriteria(function (Parameters $parameters): bool|string {
if (!$parameters->allowedKeys(array_map(fn (self $case) => $case->value, self::cases()))) {
if (!$parameters->allowedNames(array_map(fn (self $case) => $case->value, self::cases()))) {
return 'The cache contains invalid parameters.';
}

$hit = !in_array($parameters->valueByKey(self::Hit->value, default: false), [null, false], true);
$fwd = $parameters->valueByKey(self::Forward->value);
$hit = !in_array($parameters->valueByName(self::Hit->value, default: false), [null, false], true);
$fwd = $parameters->valueByName(self::Forward->value);

return match (true) {
!$hit && null !== $fwd,
Expand Down

0 comments on commit 6153565

Please sign in to comment.