Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
3 / 3 |
RecurrenceTrait | |
100.00% |
1 / 1 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
3 / 3 |
getRecurrence | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
setRecurrence | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
<?php | |
declare(strict_types=1); | |
namespace Korobochkin\WPKit\Cron\Traits; | |
/** | |
* Trait RecurrenceTrait | |
* @package Korobochkin\WPKit\Cron\Traits | |
*/ | |
trait RecurrenceTrait | |
{ | |
/** | |
* @var string | |
*/ | |
protected $recurrence = 'hourly'; | |
/** | |
* Returns recurrence value. | |
* | |
* How often the event should reoccur. Valid values: hourly, twicedaily, daily | |
* | |
* @return string The recurrence of event. | |
*/ | |
public function getRecurrence() | |
{ | |
return $this->recurrence; | |
} | |
/** | |
* Sets the desired recurrence for event. | |
* | |
* @param $recurrence string one of allowed and registered in WP values. | |
* | |
* @return $this For chain calls. | |
*/ | |
public function setRecurrence($recurrence) | |
{ | |
$this->recurrence = $recurrence; | |
return $this; | |
} | |
} |