diff --git a/library/Result.php b/library/Result.php index 1241a6e77..f2905f815 100644 --- a/library/Result.php +++ b/library/Result.php @@ -80,7 +80,7 @@ public static function fromAdjacent( ): Result { if ($adjacent->allowsAdjacent()) { return (new Result($adjacent->isValid, $input, $rule, $parameters, $template, id: $adjacent->id)) - ->withPrefixedId($prefix) + ->withPrefix($prefix) ->withAdjacent($adjacent->withInput($input)); } @@ -111,7 +111,7 @@ public function withUnchangeableId(string $id): self return $this->clone(id: $id, unchangeableId: true); } - public function withPrefixedId(string $prefix): self + public function withPrefix(string $prefix): self { if ($this->id === $this->name || $this->unchangeableId) { return $this; diff --git a/library/Rules/Not.php b/library/Rules/Not.php index 33cb3cc0a..7221c33b1 100644 --- a/library/Rules/Not.php +++ b/library/Rules/Not.php @@ -18,6 +18,6 @@ final class Not extends Wrapper { public function evaluate(mixed $input): Result { - return $this->rule->evaluate($input)->withInvertedMode()->withPrefixedId('not'); + return $this->rule->evaluate($input)->withInvertedMode()->withPrefix('not'); } } diff --git a/library/Rules/NullOr.php b/library/Rules/NullOr.php index fc165571f..b34d492fc 100644 --- a/library/Rules/NullOr.php +++ b/library/Rules/NullOr.php @@ -41,7 +41,7 @@ private function enrichResult(Result $result): Result { if ($result->allowsAdjacent()) { return $result - ->withPrefixedId('nullOr') + ->withPrefix('nullOr') ->withAdjacent(new Result($result->isValid, $result->input, $this)); } diff --git a/library/Rules/UndefOr.php b/library/Rules/UndefOr.php index bb27bddd1..b108b1dd0 100644 --- a/library/Rules/UndefOr.php +++ b/library/Rules/UndefOr.php @@ -44,7 +44,7 @@ private function enrichResult(Result $result): Result { if ($result->allowsAdjacent()) { return $result - ->withPrefixedId('undefOr') + ->withPrefix('undefOr') ->withAdjacent(new Result($result->isValid, $result->input, $this)); } diff --git a/tests/unit/Rules/NotTest.php b/tests/unit/Rules/NotTest.php index c5d5201f3..85339f171 100644 --- a/tests/unit/Rules/NotTest.php +++ b/tests/unit/Rules/NotTest.php @@ -28,7 +28,7 @@ public function shouldInvertTheResultOfWrappedRule(): void self::assertEquals( $rule->evaluate('input'), - $wrapped->evaluate('input')->withPrefixedId('not')->withInvertedMode() + $wrapped->evaluate('input')->withPrefix('not')->withInvertedMode() ); }