public function removeStep($stepIdentifier)
{
$removedOccurrences = 0;
foreach ($this->steps as $previousStepIdentifier => $steps) {
foreach ($steps as $step) {
if ($step->getIdentifier() === $stepIdentifier) {
unset($this->steps[$previousStepIdentifier][$stepIdentifier]);
$removedOccurrences++;
}
}
}
if ($removedOccurrences === 0) {
throw new FlowException(sprintf('Cannot remove sequence step with identifier "%s" because no such step exists in the given sequence.', $stepIdentifier), 1322591669);
}
}