public function fillIndex($index)
    {
        /** @param Command $value */
        $map = function ($value) use ($index) {
            if ($value->getIndex() === null) {
                $value->index($index);
            }
        };

        array_map($map, $this->commands);

        return $this;
    }
public function fillIndex($index)
    {
        /** @param Command $value */
        $map = function ($value) use ($index) {
            if ($value->getIndex() === null) {
                $value->index($index);
            }
        };

        array_map($map, $this->commands);

        return $this;
    }
public function fillIndex ( $ index ) { /** @param Command $value */ $ map = function ( $ value ) use ( $ index ) { if ( $ value -> getIndex ( ) === null ) { $ value -> index ( $ index ) ; } } ; array_map ( $ map , $ this -> commands ) ; return $ this ; }
Fill all commands that don't have an index set

@param $index

@return $this
Fill all commands that don t have an index set