Esempio n. 1
0
 /**
  * @param EntityId|SiteLink $target
  *
  * @throws UnexpectedValueException
  * @return array
  *
  * @todo Fix duplicated code
  */
 private function getTargetParamsFromTarget($target)
 {
     if ($target instanceof EntityId) {
         return array('id' => $target->getSerialization());
     } elseif ($target instanceof SiteLink) {
         return array('site' => $target->getSiteId(), 'title' => $target->getPageName());
     } else {
         throw new UnexpectedValueException('$target needs to be an EntityId or SiteLink');
     }
 }