From 2570928b00d9c6ff8d05b427f45a1a76684a51e9 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Wed, 10 May 2023 14:55:10 +0200 Subject: [PATCH] PHPDoc --- includes/class-scheduler.php | 10 ++++++++++ includes/collection/class-followers.php | 16 ++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/includes/class-scheduler.php b/includes/class-scheduler.php index 4291365..0373c3f 100644 --- a/includes/class-scheduler.php +++ b/includes/class-scheduler.php @@ -21,6 +21,11 @@ class Scheduler { \add_action( 'activitypub_cleanup_followers', array( self::class, 'cleanup_followers' ) ); } + /** + * Schedule all ActivityPub schedules. + * + * @return void + */ public static function register_schedules() { if ( ! \wp_next_scheduled( 'activitypub_update_followers' ) ) { \wp_schedule_event( time(), 'hourly', 'activitypub_update_followers' ); @@ -31,6 +36,11 @@ class Scheduler { } } + /** + * Unscedule all ActivityPub schedules. + * + * @return void + */ public static function deregister_schedules() { wp_unschedule_hook( 'activitypub_update_followers' ); wp_unschedule_hook( 'activitypub_cleanup_followers' ); diff --git a/includes/collection/class-followers.php b/includes/collection/class-followers.php index 0fa4a6a..1d54fa2 100644 --- a/includes/collection/class-followers.php +++ b/includes/collection/class-followers.php @@ -406,9 +406,13 @@ class Followers { } /** - * Undocumented function + * Get all Followers that have not been updated for a given time * - * @return void + * @param enum $output The output format, supported ARRAY_N, OBJECT and ACTIVITYPUB_OBJECT. + * @param int $number Limits the result. + * @param int $older_than The time in seconds. + * + * @return mixed The Term list of Followers, the format depends on $output. */ public static function get_outdated_followers( $output = ARRAY_N, $number = 50, $older_than = 604800 ) { $args = array( @@ -449,6 +453,14 @@ class Followers { } } + /** + * Get all Followers that had errors + * + * @param enum $output The output format, supported ARRAY_N, OBJECT and ACTIVITYPUB_OBJECT + * @param integer $number The number of Followers to return. + * + * @return mixed The Term list of Followers, the format depends on $output. + */ public static function get_faulty_followers( $output = ARRAY_N, $number = 10 ) { $args = array( 'taxonomy' => self::TAXONOMY,