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; }
/** * 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; }