From d6687e070e05922c41bb01caed53ef1b15c60c2e Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Tue, 17 Mar 2015 21:11:43 +0000 Subject: [PATCH] #1333 - Removing useless `is_string()` function call, clarifying docblock parameters --- lib/Doctrine/ORM/UnitOfWork.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index 3e19e53af..53596a671 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -1566,19 +1566,17 @@ class UnitOfWork implements PropertyChangedListener * * @ignore * - * @param string $idHash + * @param mixed $idHash (must be possible to cast it to string) * @param string $rootClassName * * @return object|bool The found entity or FALSE. */ public function tryGetByIdHash($idHash, $rootClassName) { - if (! is_string($idHash)) { - $idHash = (string) $idHash; - } + $stringIdHash = (string) $idHash; - if (isset($this->identityMap[$rootClassName][$idHash])) { - return $this->identityMap[$rootClassName][$idHash]; + if (isset($this->identityMap[$rootClassName][$stringIdHash])) { + return $this->identityMap[$rootClassName][$stringIdHash]; } return false;