DataSift\Storyplayer\PlayerLib\Story::getOneAction PHP Method

getOneAction() public method

pick one action at random, and return it to the caller
public getOneAction ( ) : callable
return callable
    public function getOneAction()
    {
        // do we have any callbacks to pick from?
        if (count($this->actionsCallbacks) == 0) {
            throw new E5xx_NoStoryActions($this->getName());
        }
        // pick one story
        $i = rand(0, count($this->actionsCallbacks) - 1);
        // return it to the caller
        return $this->actionsCallbacks[$i];
    }