From 15db91b8f66f6f0c7e48a29201a92fe4d7d8cb7d Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Mon, 28 Sep 2015 12:19:57 -0500 Subject: [PATCH] Fix minor issues highlighted by Scrutinizer --- src/Uuid.php | 16 ++++++++-------- src/UuidInterface.php | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Uuid.php b/src/Uuid.php index 1a695ff..a79604c 100644 --- a/src/Uuid.php +++ b/src/Uuid.php @@ -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() diff --git a/src/UuidInterface.php b/src/UuidInterface.php index 48c9078..edb0fcd 100644 --- a/src/UuidInterface.php +++ b/src/UuidInterface.php @@ -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);