Skip to content

Commit 0e40917

Browse files
committed
Rename 'withPrefixedId' to 'withPrefix'
That makes the name shorter and it has the same meaning.
1 parent 33e6341 commit 0e40917

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

library/Result.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public static function fromAdjacent(
8080
): Result {
8181
if ($adjacent->allowsAdjacent()) {
8282
return (new Result($adjacent->isValid, $input, $rule, $parameters, $template, id: $adjacent->id))
83-
->withPrefixedId($prefix)
83+
->withPrefix($prefix)
8484
->withAdjacent($adjacent->withInput($input));
8585
}
8686

@@ -111,7 +111,7 @@ public function withUnchangeableId(string $id): self
111111
return $this->clone(id: $id, unchangeableId: true);
112112
}
113113

114-
public function withPrefixedId(string $prefix): self
114+
public function withPrefix(string $prefix): self
115115
{
116116
if ($this->id === $this->name || $this->unchangeableId) {
117117
return $this;

library/Rules/Not.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ final class Not extends Wrapper
1818
{
1919
public function evaluate(mixed $input): Result
2020
{
21-
return $this->rule->evaluate($input)->withInvertedMode()->withPrefixedId('not');
21+
return $this->rule->evaluate($input)->withInvertedMode()->withPrefix('not');
2222
}
2323
}

library/Rules/NullOr.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ private function enrichResult(Result $result): Result
4141
{
4242
if ($result->allowsAdjacent()) {
4343
return $result
44-
->withPrefixedId('nullOr')
44+
->withPrefix('nullOr')
4545
->withAdjacent(new Result($result->isValid, $result->input, $this));
4646
}
4747

library/Rules/UndefOr.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ private function enrichResult(Result $result): Result
4444
{
4545
if ($result->allowsAdjacent()) {
4646
return $result
47-
->withPrefixedId('undefOr')
47+
->withPrefix('undefOr')
4848
->withAdjacent(new Result($result->isValid, $result->input, $this));
4949
}
5050

tests/unit/Rules/NotTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function shouldInvertTheResultOfWrappedRule(): void
2828

2929
self::assertEquals(
3030
$rule->evaluate('input'),
31-
$wrapped->evaluate('input')->withPrefixedId('not')->withInvertedMode()
31+
$wrapped->evaluate('input')->withPrefix('not')->withInvertedMode()
3232
);
3333
}
3434

0 commit comments

Comments
 (0)