for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Ivory\Value\Alg;
/**
* Implements the {@link IEqualable::equals()} using the {@link IComparable::compareTo()} method.
*/
trait EqualableWithCompareTo
{
abstract public function compareTo($other): ?int;
public function equals($other): bool
if ($other === null) {
return false;
}
return ($this->compareTo($other) == 0);