Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 801b968

Browse files
committed
chore: improved comparison naming
1 parent cce236e commit 801b968

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/Rule/AbstractComparisonRule.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function assert(mixed $value, string $name): void
1818
);
1919
}
2020

21-
if (!$this->comparison($value, $this->constraint)) {
21+
if (!$this->compareValues($value, $this->constraint)) {
2222
throw new ($this->getException())(
2323
message: $this->options['message'],
2424
parameters: [
@@ -30,7 +30,7 @@ public function assert(mixed $value, string $name): void
3030
}
3131
}
3232

33-
protected abstract function comparison(mixed $value1, mixed $value2): bool;
33+
protected abstract function compareValues(mixed $value1, mixed $value2): bool;
3434

3535
protected abstract function getException(): string;
3636
}

src/Rule/GreaterThan.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function __construct(
2323
$this->options = $resolver->resolve($options);
2424
}
2525

26-
protected function comparison(mixed $value1, mixed $value2): bool
26+
protected function compareValues(mixed $value1, mixed $value2): bool
2727
{
2828
if (\is_string($value1) && \is_string($value2)) {
2929
return strcmp($value1, $value2) > 0;

src/Rule/GreaterThanOrEqual.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function __construct(
2323
$this->options = $resolver->resolve($options);
2424
}
2525

26-
protected function comparison(mixed $value1, mixed $value2): bool
26+
protected function compareValues(mixed $value1, mixed $value2): bool
2727
{
2828
if (\is_string($value1) && \is_string($value2)) {
2929
return strcmp($value1, $value2) >= 0;

src/Rule/LessThan.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function __construct(
2323
$this->options = $resolver->resolve($options);
2424
}
2525

26-
protected function comparison(mixed $value1, mixed $value2): bool
26+
protected function compareValues(mixed $value1, mixed $value2): bool
2727
{
2828
if (\is_string($value1) && \is_string($value2)) {
2929
return strcmp($value1, $value2) < 0;

src/Rule/LessThanOrEqual.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function __construct(
2323
$this->options = $resolver->resolve($options);
2424
}
2525

26-
protected function comparison(mixed $value1, mixed $value2): bool
26+
protected function compareValues(mixed $value1, mixed $value2): bool
2727
{
2828
if (\is_string($value1) && \is_string($value2)) {
2929
return strcmp($value1, $value2) <= 0;

0 commit comments

Comments
 (0)