mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-14 15:56:48 +03:00
Fix minor issues highlighted by Scrutinizer
This commit is contained in:
+8
-8
@@ -188,30 +188,30 @@ class Uuid implements UuidInterface
|
||||
return $this->toString();
|
||||
}
|
||||
|
||||
public function compareTo(UuidInterface $uuid)
|
||||
public function compareTo(UuidInterface $other)
|
||||
{
|
||||
$comparison = 0;
|
||||
|
||||
if ($this->getMostSignificantBitsHex() < $uuid->getMostSignificantBitsHex()) {
|
||||
if ($this->getMostSignificantBitsHex() < $other->getMostSignificantBitsHex()) {
|
||||
$comparison = -1;
|
||||
} elseif ($this->getMostSignificantBitsHex() > $uuid->getMostSignificantBitsHex()) {
|
||||
} elseif ($this->getMostSignificantBitsHex() > $other->getMostSignificantBitsHex()) {
|
||||
$comparison = 1;
|
||||
} elseif ($this->getLeastSignificantBitsHex() < $uuid->getLeastSignificantBitsHex()) {
|
||||
} elseif ($this->getLeastSignificantBitsHex() < $other->getLeastSignificantBitsHex()) {
|
||||
$comparison = -1;
|
||||
} elseif ($this->getLeastSignificantBitsHex() > $uuid->getLeastSignificantBitsHex()) {
|
||||
} elseif ($this->getLeastSignificantBitsHex() > $other->getLeastSignificantBitsHex()) {
|
||||
$comparison = 1;
|
||||
}
|
||||
|
||||
return $comparison;
|
||||
}
|
||||
|
||||
public function equals($obj)
|
||||
public function equals($other)
|
||||
{
|
||||
if (!($obj instanceof UuidInterface)) {
|
||||
if (!($other instanceof UuidInterface)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return ($this->compareTo($obj) == 0);
|
||||
return ($this->compareTo($other) == 0);
|
||||
}
|
||||
|
||||
public function getBytes()
|
||||
|
||||
@@ -32,7 +32,7 @@ interface UuidInterface extends \JsonSerializable
|
||||
* * Q. What's the value of being able to sort UUIDs?
|
||||
* * A. Use them as keys in a B-Tree or similar mapping.
|
||||
*
|
||||
* @param UuidInterface $uuid UUID to which this UUID is compared
|
||||
* @param UuidInterface $other UUID to which this UUID is compared
|
||||
* @return int -1, 0 or 1 as this UUID is less than, equal to, or greater than `$uuid`
|
||||
*/
|
||||
public function compareTo(UuidInterface $other);
|
||||
@@ -44,8 +44,8 @@ interface UuidInterface extends \JsonSerializable
|
||||
* object, has the same variant, and contains the same value, bit for bit,
|
||||
* as this UUID.
|
||||
*
|
||||
* @param object $obj
|
||||
* @return bool True if `$obj` is equal to this UUID
|
||||
* @param object $other
|
||||
* @return bool True if `$other` is equal to this UUID
|
||||
*/
|
||||
public function equals($other);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user