summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/modules/videopress/class.videopress-scheduler.php')
-rw-r--r--plugins/jetpack/modules/videopress/class.videopress-scheduler.php28
1 files changed, 18 insertions, 10 deletions
diff --git a/plugins/jetpack/modules/videopress/class.videopress-scheduler.php b/plugins/jetpack/modules/videopress/class.videopress-scheduler.php
index bff33684..d8ac4610 100644
--- a/plugins/jetpack/modules/videopress/class.videopress-scheduler.php
+++ b/plugins/jetpack/modules/videopress/class.videopress-scheduler.php
@@ -1,8 +1,12 @@
-<?php
+<?php // phpcs:ignore WordPress.Files.FileName
/**
- * VideoPress playback module markup generator.
+ * VideoPress cron scheduler.
*
- * @since 1.3
+ * @package automattic/jetpack
+ */
+
+/**
+ * VideoPress Cron Scheduler.
*/
class VideoPress_Scheduler {
@@ -12,7 +16,9 @@ class VideoPress_Scheduler {
const CLEANUP_CRON_METHOD = 'videopress_cleanup_media_library';
/**
- * @var VideoPress_Scheduler
+ * Singleton instance.
+ *
+ * @var VideoPress_Scheduler $instance A VideoPress_Scheduler singleton instance (default null)
**/
private static $instance = null;
@@ -22,13 +28,13 @@ class VideoPress_Scheduler {
* @var array
*/
protected $crons = array(
+ // phpcs:ignore Squiz.PHP.CommentedOutCode.Found
// 'cleanup' => array(
// 'method' => self::CLEANUP_CRON_METHOD,
// 'interval' => 'minutes_30',
// ),
);
-
/**
* Private VideoPress_Scheduler constructor.
*
@@ -53,7 +59,7 @@ class VideoPress_Scheduler {
* @return VideoPress_Scheduler
*/
public static function init() {
- if ( is_null( self::$instance ) ) {
+ if ( self::$instance === null ) {
self::$instance = new VideoPress_Scheduler();
}
@@ -83,7 +89,7 @@ class VideoPress_Scheduler {
/**
* Activate a single cron
*
- * @param string $cron_name
+ * @param string $cron_name The name of the cron to activate.
*
* @return bool
*/
@@ -117,7 +123,7 @@ class VideoPress_Scheduler {
/**
* Only activate the crons if it is Jetpack that was activated.
*
- * @param string $plugin_file_name
+ * @param string $plugin_file_name The name of the plugin that was activated.
*/
public function activate_crons_on_jetpack_activation( $plugin_file_name ) {
@@ -129,6 +135,8 @@ class VideoPress_Scheduler {
/**
* Deactivates any crons associated with the VideoPress module.
*
+ * @param string $cron_name Name of the cron to deactivate.
+ *
* @return bool
*/
public function deactivate_cron( $cron_name ) {
@@ -158,7 +166,7 @@ class VideoPress_Scheduler {
*
* If so, return when it will next run,
*
- * @param string $cron_name
+ * @param string $cron_name Cron job name.
*
* @return int|bool Timestamp of the next run time OR false.
*/
@@ -173,7 +181,7 @@ class VideoPress_Scheduler {
/**
* Check that the given cron job name is valid.
*
- * @param string $cron_name
+ * @param string $cron_name Cron job name.
*
* @return bool
*/