protected function getStepType($wizardStep)
{
if (($type = $wizardStep->getStepType()) === TWizardStepType::Auto) {
$steps = $this->getWizardSteps();
if (($index = $steps->indexOf($wizardStep)) >= 0) {
$stepCount = $steps->getCount();
if ($stepCount === 1 || $index < $stepCount - 1 && $steps->itemAt($index + 1)->getStepType() === TWizardStepType::Complete) {
return TWizardStepType::Finish;
} else {
if ($index === 0) {
return TWizardStepType::Start;
} else {
if ($index === $stepCount - 1) {
return TWizardStepType::Finish;
} else {
return TWizardStepType::Step;
}
}
}
} else {
return $type;
}
} else {
return $type;
}
}