<?php
namespace FuseCommerce\Hooks;
if ( ! defined( 'ABSPATH' ) ) exit;

use FuseCommerce\Hooks\IHook;

class FilterCronSchedules implements IHook {

    const EVERY_MINUTE = 'fuse_comm_everyminute';

    static function register() {
        add_filter('cron_schedules', [self::class, 'on_cron_schedules']);
    }

    static function on_cron_schedules($schedules) {

        $schedules[self::EVERY_MINUTE] = [
            'interval'  => 60, // time in seconds
            'display'   => 'Every minute'
        ];

        return $schedules;
    }
}