| 1 |
<?php |
| 2 |
/** |
| 3 |
* WordPress feature flag context implementation. |
| 4 |
* |
| 5 |
* @package wp-crontrol |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace Crontrol\Context; |
| 9 |
|
| 10 |
use function Crontrol\php_cron_events_enabled; |
| 11 |
use function Crontrol\url_cron_events_enabled; |
| 12 |
|
| 13 |
/** |
| 14 |
* FeatureContext implementation that checks WordPress constants and options. |
| 15 |
* |
| 16 |
* This is the production implementation that reads from the WordPress environment. |
| 17 |
*/ |
| 18 |
class WordPressFeatureContext implements FeatureContext { |
| 19 |
#[\Override] |
| 20 |
public function php_crons_enabled(): bool { |
| 21 |
return php_cron_events_enabled(); |
| 22 |
} |
| 23 |
|
| 24 |
#[\Override] |
| 25 |
public function url_crons_enabled(): bool { |
| 26 |
return url_cron_events_enabled(); |
| 27 |
} |
| 28 |
} |
| 29 |
|