本文整理汇总了PHP中Step::__toString方法的典型用法代码示例。如果您正苦于以下问题:PHP Step::__toString方法的具体用法?PHP Step::__toString怎么用?PHP Step::__toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Step
的用法示例。
在下文中一共展示了Step::__toString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: label
/**
* Returns a label identifying this round in the game.
* The label is unique to steps in this game.
*
* Currently, the format for the label is 'step_X[_repetition_Y]',
* where X is the order of this step.
*
* @throws InvalidArgumentException if this step is repeated, but no repetition was supplied; or if this is an invalid repetition
* @return string unique label for this step and repetition
*/
public function label()
{
$step_identifier = $this->step->__toString();
//TODO: a better idea might be to use the step code rather than its order
if ($this->step->isRepeated()) {
return $step_identifier . '_repetition_' . $this->repetition;
} else {
return $step_identifier;
}
}