本文整理汇总了PHP中Cron\CronExpression::getExpression方法的典型用法代码示例。如果您正苦于以下问题:PHP CronExpression::getExpression方法的具体用法?PHP CronExpression::getExpression怎么用?PHP CronExpression::getExpression使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cron\CronExpression
的用法示例。
在下文中一共展示了CronExpression::getExpression方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testParsesCronSchedule
/**
* @covers Cron\CronExpression::__construct
* @covers Cron\CronExpression::getExpression
*/
public function testParsesCronSchedule()
{
$cron = new CronExpression('1 2-4 * 4,5,6 */3', '2010-09-10 12:00:00');
$this->assertEquals('1', $cron->getExpression(CronExpression::MINUTE));
$this->assertEquals('2-4', $cron->getExpression(CronExpression::HOUR));
$this->assertEquals('*', $cron->getExpression(CronExpression::DAY));
$this->assertEquals('4,5,6', $cron->getExpression(CronExpression::MONTH));
$this->assertEquals('*/3', $cron->getExpression(CronExpression::WEEKDAY));
$this->assertEquals('1 2-4 * 4,5,6 */3', $cron->getExpression());
$this->assertNull($cron->getExpression('foo'));
}
示例2: getExpression
/**
* Get the cron expression.
*
* @return string
*/
public function getExpression()
{
return $this->cronExpression->getExpression();
}
示例3: getExpression
/**
* Get CRON expression
*
* @return string
*/
public function getExpression()
{
return $this->cronExpression instanceof CronExpression ? $this->cronExpression->getExpression() : '';
}
示例4: getExpression
/**
* Get cron expression.
*
* @return string
*/
public function getExpression()
{
$expression = $this->expression ? $this->expression->getExpression() : '';
return !array_key_exists($expression, $this->expressionMapper) ? $expression : $this->expressionMapper[$expression];
}