From 951800eca6045f6e0dc1e9a12c225c8e55b044e9 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Thu, 14 Nov 2024 18:40:15 +0000 Subject: Several issues discovered by PHPStan --- Zotlabs/Lib/Activity.php | 75 ------------------------------------------------ 1 file changed, 75 deletions(-) (limited to 'Zotlabs/Lib/Activity.php') diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 9a8ac4a39..448b88ff4 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -1289,81 +1289,6 @@ class Activity { // return false; } - static function activity_decode_mapper($verb) { - - $acts = [ - 'http://activitystrea.ms/schema/1.0/post' => 'Create', - // 'http://activitystrea.ms/schema/1.0/share' => 'Announce', - 'http://activitystrea.ms/schema/1.0/update' => 'Update', - 'http://activitystrea.ms/schema/1.0/like' => 'Like', - 'http://activitystrea.ms/schema/1.0/favorite' => 'Like', - 'http://purl.org/zot/activity/dislike' => 'Dislike', - // 'http://activitystrea.ms/schema/1.0/tag' => 'Add', - 'http://activitystrea.ms/schema/1.0/follow' => 'Follow', - 'http://activitystrea.ms/schema/1.0/unfollow' => 'Unfollow', - 'http://activitystrea.ms/schema/1.0/stop-following' => 'Unfollow', - 'http://purl.org/zot/activity/attendyes' => 'Accept', - 'http://purl.org/zot/activity/attendno' => 'Reject', - 'http://purl.org/zot/activity/attendmaybe' => 'TentativeAccept', - 'Announce' => 'Announce', - 'Invite' => 'Invite', - 'Delete' => 'Delete', - 'Undo' => 'Undo', - 'Add' => 'Add', - 'Remove' => 'Remove' - ]; - - call_hooks('activity_decode_mapper', $acts); - - foreach ($acts as $k => $v) { - if ($verb === $v) { - return $k; - } - } - - logger('Unmapped activity: ' . $verb); - return 'Create'; - - } - - static function activity_obj_decode_mapper($obj) { - - $objs = [ - 'http://activitystrea.ms/schema/1.0/note' => 'Note', - 'http://activitystrea.ms/schema/1.0/note' => 'Article', - 'http://activitystrea.ms/schema/1.0/comment' => 'Note', - 'http://activitystrea.ms/schema/1.0/person' => 'Person', - 'http://purl.org/zot/activity/profile' => 'Profile', - 'http://activitystrea.ms/schema/1.0/photo' => 'Image', - 'http://activitystrea.ms/schema/1.0/profile-photo' => 'Icon', - 'http://activitystrea.ms/schema/1.0/event' => 'Event', - 'http://purl.org/zot/activity/location' => 'Place', - 'http://purl.org/zot/activity/chessgame' => 'Game', - 'http://purl.org/zot/activity/tagterm' => 'zot:Tag', - 'http://purl.org/zot/activity/thing' => 'Object', - 'http://purl.org/zot/activity/file' => 'zot:File', - 'http://purl.org/zot/activity/mood' => 'zot:Mood', - 'Invite' => 'Invite', - 'Question' => 'Question', - 'Document' => 'Document', - 'Audio' => 'Audio', - 'Video' => 'Video', - 'Delete' => 'Delete', - 'Undo' => 'Undo' - ]; - - call_hooks('activity_obj_decode_mapper', $objs); - - foreach ($objs as $k => $v) { - if ($obj === $v) { - return $k; - } - } - - logger('Unmapped activity object: ' . $obj); - return 'Note'; - } - static function activity_obj_mapper($obj) { $objs = [ -- cgit v1.2.3