Remove unused code

- Remove commented code
- Remove unused/immediately overwritten variables
- Remove extraneous parameters
- Remove unreachable code
- Remove duplicate array keys
This commit is contained in:
Hypolite Petovan 2019-01-07 12:09:10 -05:00
parent 0c4f8277e6
commit 4a95ca280d
42 changed files with 43 additions and 218 deletions

View file

@ -398,8 +398,6 @@ class OStatus
$authordata = $xpath->query('//author')->item(0);
$author = self::fetchAuthor($xpath, $authordata, $importer, $contact, $stored);
$entry = $xpath->query('/atom:entry');
// Reverse the order of the entries
$entrylist = [];
@ -528,7 +526,6 @@ class OStatus
if ($valid) {
$default_contact = 0;
$key = count(self::$itemlist);
for ($key = count(self::$itemlist) - 1; $key >= 0; $key--) {
if (empty(self::$itemlist[$key]['contact-id'])) {
self::$itemlist[$key]['contact-id'] = $default_contact;
@ -1191,7 +1188,6 @@ class OStatus
} else {
return "http://".$server[0]."/notice/".$conversation[1];
}
return $href;
}
/**
@ -1287,8 +1283,6 @@ class OStatus
*/
private static function addHeader(DOMDocument $doc, array $owner, $filter, $feed_mode = false)
{
$a = \get_app();
$root = $doc->createElementNS(NAMESPACE_ATOM1, 'feed');
$doc->appendChild($root);
@ -1699,7 +1693,7 @@ class OStatus
Logger::log("OStatus entry is from author ".$owner["url"]." - not from ".$item["author-link"].". Quitting.", Logger::DEBUG);
}
$title = self::entryHeader($doc, $entry, $owner, $item, $toplevel);
self::entryHeader($doc, $entry, $owner, $item, $toplevel);
$condition = ['uid' => $owner["uid"], 'guid' => $repeated_guid, 'private' => false,
'network' => [Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS]];
@ -1764,7 +1758,7 @@ class OStatus
Logger::log("OStatus entry is from author ".$owner["url"]." - not from ".$item["author-link"].". Quitting.", Logger::DEBUG);
}
$title = self::entryHeader($doc, $entry, $owner, $item, $toplevel);
self::entryHeader($doc, $entry, $owner, $item, $toplevel);
$verb = NAMESPACE_ACTIVITY_SCHEMA."favorite";
self::entryContent($doc, $entry, $item, $owner, "Favorite", $verb, false);