| 1 |
<?php |
| 2 |
/** |
| 3 |
* The scheduled task contract. |
| 4 |
* |
| 5 |
* @package SolidWP\Performance |
| 6 |
*/ |
| 7 |
|
| 8 |
declare( strict_types=1 ); |
| 9 |
|
| 10 |
namespace SolidWP\Performance\Cron\Contracts; |
| 11 |
|
| 12 |
/** |
| 13 |
* The scheduled task contract. |
| 14 |
* |
| 15 |
* @package SolidWP\Performance |
| 16 |
*/ |
| 17 |
interface Task { |
| 18 |
|
| 19 |
/** |
| 20 |
* Run the task when the scheduler executes the task. |
| 21 |
* |
| 22 |
* @return mixed |
| 23 |
*/ |
| 24 |
public function run(); |
| 25 |
|
| 26 |
/** |
| 27 |
* The unique hook name to register. |
| 28 |
* |
| 29 |
* @return string |
| 30 |
*/ |
| 31 |
public function hook(): string; |
| 32 |
|
| 33 |
/** |
| 34 |
* How often the event should subsequently recur. |
| 35 |
* |
| 36 |
* @see wp_get_schedules() for accepted values. |
| 37 |
* |
| 38 |
* @return string |
| 39 |
*/ |
| 40 |
public function recurrence(): string; |
| 41 |
} |
| 42 |
|