* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
- private static function fetchAuthor(DOMXPath $xpath, $context, array $importer, array &$contact, $onlyfetch)
+ private static function fetchAuthor(DOMXPath $xpath, $context, array $importer, array &$contact = null, $onlyfetch)
{
$author = [];
$author["author-link"] = XML::getFirstNodeValue($xpath, 'atom:author/atom:uri/text()', $context);
}
$author["author-id"] = Contact::getIdForURL($author["author-link"]);
- $author["contact-id"] = $contact["id"];
+ $author['contact-id'] = defaults($contact, 'id', $author['author-id']);
$contact = [];
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
- private static function process($xml, array $importer, array &$contact, &$hub, $stored = false, $initialize = true)
+ private static function process($xml, array $importer, array &$contact = null, &$hub, $stored = false, $initialize = true)
{
if ($initialize) {
self::$itemlist = [];
* @param array $owner Contact data of the poster
* @param bool $show_profile Whether to show profile
*
- * @return object author element
+ * @return \DOMElement author element
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
private static function addAuthor(DOMDocument $doc, array $owner, $show_profile = true)
* @param bool $toplevel optional default false
* @param bool $feed_mode Behave like a regular feed for users if true
*
- * @return object Entry element
+ * @return \DOMElement Entry element
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
* @param DOMDocument $doc XML document
* @param array $contact Array of the contact that is added
*
- * @return object Source element
+ * @return \DOMElement Source element
* @throws \Exception
*/
private static function sourceEntry(DOMDocument $doc, array $contact)
* @param array $owner Contact data of the poster
* @param bool $toplevel Is it for en entry element (false) or a feed entry (true)?
*
- * @return object Entry element with "like"
+ * @return \DOMElement Entry element with "like"
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
* @param array $owner Contact data of the poster
* @param bool $toplevel Is it for en entry element (false) or a feed entry (true)?
*
- * @return object Entry element
+ * @return \DOMElement Entry element
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
* @param bool $toplevel Is it for en entry element (false) or a feed entry (true)?
* @param bool $feed_mode Behave like a regular feed for users if true
*
- * @return object Entry element
+ * @return \DOMElement Entry element
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
* @brief Adds elements to the XML document
*
* @param DOMDocument $doc XML document
- * @param object $entry Entry element where the content is added
+ * @param \DOMElement $entry Entry element where the content is added
* @param array $item Data of the item that is to be posted
* @param array $owner Contact data of the poster
* @param string $title Title for the post
* @return void
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- private static function entryContent(DOMDocument $doc, $entry, array $item, array $owner, $title, $verb = "", $complete = true, $feed_mode = false)
+ private static function entryContent(DOMDocument $doc, \DOMElement $entry, array $item, array $owner, $title, $verb = "", $complete = true, $feed_mode = false)
{
if ($verb == "") {
$verb = self::constructVerb($item);