private function getNextStep(): callable
    {
        return function (string $nextStep = null): ?BowlInterface {
            /**
             * @var Chef $this
             */

            if (!empty($nextStep) && isset($this->stepsNames[$nextStep])) {
                $this->position = $this->stepsNames[$nextStep];
            }

            if (count($this->steps) > $this->position) {
                $position = $this->position;

                $step = $this->steps[$position];
                $this->position++;

                return $step;
            }

            return null;
        };
    }
private function getNextStep(): callable
    {
        return function (string $nextStep = null): ?BowlInterface {
            /**
             * @var Chef $this
             */

            if (!empty($nextStep) && isset($this->stepsNames[$nextStep])) {
                $this->position = $this->stepsNames[$nextStep];
            }

            if (count($this->steps) > $this->position) {
                $position = $this->position;

                $step = $this->steps[$position];
                $this->position++;

                return $step;
            }

            return null;
        };
    }
private function getNextStep ( ) : callable { return function ( string $ nextStep = null ) : ? BowlInterface { /**
             * @var Chef $this
             */ if ( ! empty ( $ nextStep ) && isset ( $ this -> stepsNames [ $ nextStep ] ) ) { $ this -> position = $ this -> stepsNames [ $ nextStep ] ; } if ( count ( $ this -> steps ) > $ this -> position ) { $ position = $ this -> position ; $ step = $ this -> steps [ $ position ] ; $ this -> position ++ ; return $ step ; } return null ; } ; }
To get the next step in the cooking to execute
To get the next step in the cooking to execute