From: jenkins-bot Date: Mon, 25 Mar 2019 22:21:05 +0000 (+0000) Subject: Merge "Simplify Block::getBy and Block::getByName" X-Git-Tag: 1.34.0-rc.0~2358 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=3ebb1691397b59266e7c0d69ca44cda6733aea46;hp=bac8c6f63a1dac3dc64e3ad6b43895a6c6f2d14d;p=lhc%2Fweb%2Fwiklou.git Merge "Simplify Block::getBy and Block::getByName" --- diff --git a/includes/Block.php b/includes/Block.php index 04a5a15090..060eebd703 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -1036,10 +1036,7 @@ class Block { * @return int (0 for foreign users) */ public function getBy() { - $blocker = $this->getBlocker(); - return ( $blocker instanceof User ) - ? $blocker->getId() - : 0; + return $this->getBlocker()->getId(); } /** @@ -1048,10 +1045,7 @@ class Block { * @return string */ public function getByName() { - $blocker = $this->getBlocker(); - return ( $blocker instanceof User ) - ? $blocker->getName() - : (string)$blocker; // username + return $this->getBlocker()->getName(); } /**