for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Bavix\Geo\Comparator;
class Comparator
{
/**
* @var int
*/
protected $cmp;
* Compare constructor.
* @param int $cmp
public function __construct(int $cmp)
$this->cmp = $cmp;
}
* @return bool
public function equal(): bool
return $this->cmp === 0;
public function notEqual(): bool
return !$this->cmp;
public function less(): bool
return $this->cmp === -1;
public function greater(): bool
return $this->cmp === 1;
public function lessThanOrEqual(): bool
return $this->cmp < 1;
public function greaterThanOrEqual(): bool
return $this->cmp > -1;