/**
* Invokes a single step of this sequence and also invokes all steps registered
* to be executed after the given step.
*
* @param Step $step The step to invoke
* @param \Neos\Flow\Core\Bootstrap $bootstrap
* @return void
*/
protected function invokeStep(Step $step, Bootstrap $bootstrap)
{
$bootstrap->getSignalSlotDispatcher()->dispatch(__CLASS__, 'beforeInvokeStep', [$step, $this->identifier]);
$identifier = $step->getIdentifier();
$step($bootstrap);
$bootstrap->getSignalSlotDispatcher()->dispatch(__CLASS__, 'afterInvokeStep', [$step, $this->identifier]);
if (isset($this->steps[$identifier])) {
foreach ($this->steps[$identifier] as $followingStep) {
$this->invokeStep($followingStep, $bootstrap);
}
}
}