本文整理匯總了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];
}