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

@ -63,8 +63,6 @@ class PortableContact
*/
public static function load($cid, $uid, $zcid, $url)
{
$a = \get_app();
if ($cid) {
if (!$url || !$uid) {
$contact = DBA::selectFirst('contact', ['poco', 'uid'], ['id' => $cid]);
@ -230,7 +228,6 @@ class PortableContact
$friendica = preg_replace("=(https?://)(.*)/profile/(.*)=ism", "$1$2", $profile);
if ($friendica != $profile) {
$server_url = $friendica;
$network = Protocol::DFRN;
}
}
@ -238,7 +235,6 @@ class PortableContact
$diaspora = preg_replace("=(https?://)(.*)/u/(.*)=ism", "$1$2", $profile);
if ($diaspora != $profile) {
$server_url = $diaspora;
$network = Protocol::DIASPORA;
}
}
@ -246,7 +242,6 @@ class PortableContact
$red = preg_replace("=(https?://)(.*)/channel/(.*)=ism", "$1$2", $profile);
if ($red != $profile) {
$server_url = $red;
$network = Protocol::DIASPORA;
}
}
@ -255,7 +250,6 @@ class PortableContact
$mastodon = preg_replace("=(https?://)(.*)/users/(.*)=ism", "$1$2", $profile);
if ($mastodon != $profile) {
$server_url = $mastodon;
$network = Protocol::OSTATUS;
}
}
@ -264,7 +258,6 @@ class PortableContact
$ostatus = preg_replace("=(https?://)(.*)/user/(.*)=ism", "$1$2", $profile);
if ($ostatus != $profile) {
$server_url = $ostatus;
$network = Protocol::OSTATUS;
}
}
@ -273,7 +266,6 @@ class PortableContact
$base = preg_replace("=(https?://)(.*?)/(.*)=ism", "$1$2", $profile);
if ($base != $profile) {
$server_url = $base;
$network = Protocol::PHANTOM;
}
}
@ -609,8 +601,6 @@ class PortableContact
*/
private static function detectPocoData(array $data)
{
$server = false;
if (!isset($data['entry'])) {
return false;
}