public function addStep(Step $step, $priority = null)
    {
        $priority = null === $priority && $step instanceof PriorityStep ? $step->getPriority() : $priority;
        $priority = null === $priority ? 0 : $priority;

        $this->steps->insert($step, $priority);

        return $this;
    }
public function addStep(Step $step, $priority = null)
    {
        $priority = null === $priority && $step instanceof PriorityStep ? $step->getPriority() : $priority;
        $priority = null === $priority ? 0 : $priority;

        $this->steps->insert($step, $priority);

        return $this;
    }
public function addStep ( Step $ step , $ priority = null ) { $ priority = null === $ priority && $ step instanceof PriorityStep ? $ step -> getPriority ( ) : $ priority ; $ priority = null === $ priority ? 0 : $ priority ; $ this -> steps -> insert ( $ step , $ priority ) ; return $ this ; }
Add a step to the current workflow

@param Step         $step
@param integer|null $priority

@return $this
Add a step to the current workflow