示例#1
0
 public static function fromResponse(array $fields)
 {
     $paste = RefHeapUtils::id(new RefHeapPaste())->setUser($fields['user'])->setLines($fields['lines'])->setPrivate($fields['private'])->setDate($fields['date'])->setURL($fields['url'])->setLanguage($fields['language'])->setContents($fields['contents']);
     return $paste;
 }
示例#2
0
 /**
  * Highlight pasted text.
  *
  * @param int The ID of the paste.
  * @return string
  */
 public function highlight($id)
 {
     $result = RefHeapUtils::id(new RefHeapCURLClient())->setRequest('GET')->setURL($this->URL() . '/paste/' . $paste->getID() . '/highlight')->setParanoia($this->getParanoia)->execute()->getResult();
     return $result;
 }