Block::getBlocker always returns a User, so there is no need for
these methods to check.
Change-Id: I0319f0aee8d3fb3c89e8f63ee2f4ba05c8d36482
* @return int (0 for foreign users)
*/
public function getBy() {
- $blocker = $this->getBlocker();
- return ( $blocker instanceof User )
- ? $blocker->getId()
- : 0;
+ return $this->getBlocker()->getId();
}
/**
* @return string
*/
public function getByName() {
- $blocker = $this->getBlocker();
- return ( $blocker instanceof User )
- ? $blocker->getName()
- : (string)$blocker; // username
+ return $this->getBlocker()->getName();
}
/**