Skip to content
Merged
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
10 changes: 5 additions & 5 deletions src/Parsing/V2/Field/FieldConfidence.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function rank(): int
* @param FieldConfidence $other Other confidence value.
* @return boolean True if this confidence is lower than or equal to the other.
*/
public function lte(FieldConfidence $other): bool
public function lessThanOrEqual(FieldConfidence $other): bool
{
return $this->rank() <= $other->rank();
}
Expand All @@ -37,7 +37,7 @@ public function lte(FieldConfidence $other): bool
* @param FieldConfidence $other Other confidence value.
* @return boolean True if this confidence is greater than or equal to the other.
*/
public function gte(FieldConfidence $other): bool
public function greaterThanOrEqual(FieldConfidence $other): bool
{
return $this->rank() >= $other->rank();
}
Expand All @@ -47,7 +47,7 @@ public function gte(FieldConfidence $other): bool
* @param FieldConfidence $other Other confidence value.
* @return boolean True if this confidence is lower than the other.
*/
public function lt(FieldConfidence $other): bool
public function lessThan(FieldConfidence $other): bool
{
return $this->rank() < $other->rank();
}
Expand All @@ -58,7 +58,7 @@ public function lt(FieldConfidence $other): bool
* @param FieldConfidence $other Other confidence value.
* @return boolean True if this confidence is greater than the other.
*/
public function gt(FieldConfidence $other): bool
public function greaterThan(FieldConfidence $other): bool
{
return $this->rank() > $other->rank();
}
Expand All @@ -69,7 +69,7 @@ public function gt(FieldConfidence $other): bool
* @param FieldConfidence $other Other confidence value.
* @return boolean True if this confidence is equal to the other.
*/
public function eq(FieldConfidence $other): bool
public function equal(FieldConfidence $other): bool
{
return $this === $other;
}
Expand Down
10 changes: 7 additions & 3 deletions tests/V2/Parsing/InferenceResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,15 @@ public function testCoordinatesAndLocationDataMustBeAccessible(): void
);
$this->assertEquals(FieldConfidence::Medium, $dateField->confidence);
$this->assertEquals(FieldConfidence::Medium->rank(), $dateField->confidence->rank());
$this->assertTrue(FieldConfidence::Medium->eq($dateField->confidence));
$this->assertTrue(FieldConfidence::Medium->equal($dateField->confidence));
$this->assertLessThan(FieldConfidence::High->rank(), $dateField->confidence->rank());
$this->assertTrue(FieldConfidence::High->gt($dateField->confidence));
$this->assertTrue(FieldConfidence::High->greaterThan($dateField->confidence));
$this->assertTrue(FieldConfidence::Medium->greaterThanOrEqual($dateField->confidence));
$this->assertTrue(FieldConfidence::High->greaterThanOrEqual($dateField->confidence));
$this->assertGreaterThan(FieldConfidence::Low->rank(), $dateField->confidence->rank());
$this->assertTrue(FieldConfidence::Low->lt($dateField->confidence));
$this->assertTrue(FieldConfidence::Low->lessThan($dateField->confidence));
$this->assertTrue(FieldConfidence::Low->lessThanOrEqual($dateField->confidence));
$this->assertTrue(FieldConfidence::Medium->lessThanOrEqual($dateField->confidence));
$this->assertEquals('Medium', $dateField->confidence->value);
}

Expand Down