src/Phinx/Db/Util/AlterInstructions.php
public function execute($alterTemplate, callable $executor)
    {
        if ($this->alterParts) {
            $alter = sprintf($alterTemplate, implode(', ', $this->alterParts));
            $executor($alter);
        }

        $state = [];

        foreach ($this->postSteps as $instruction) {
            if (is_callable($instruction)) {
                $state = $instruction($state);
                continue;
            }

            $executor($instruction);
        }
    }
public function execute($alterTemplate, callable $executor)
    {
        if ($this->alterParts) {
            $alter = sprintf($alterTemplate, implode(', ', $this->alterParts));
            $executor($alter);
        }

        $state = [];

        foreach ($this->postSteps as $instruction) {
            if (is_callable($instruction)) {
                $state = $instruction($state);
                continue;
            }

            $executor($instruction);
        }
    }
public function execute ( $ alterTemplate , callable $ executor ) { if ( $ this -> alterParts ) { $ alter = sprintf ( $ alterTemplate , implode ( ', ' , $ this -> alterParts ) ) ; $ executor ( $ alter ) ; } $ state = [ ] ; foreach ( $ this -> postSteps as $ instruction ) { if ( is_callable ( $ instruction ) ) { $ state = $ instruction ( $ state ) ; continue ; } $ executor ( $ instruction ) ; } }
Executes the ALTER instruction and all of the post steps.

@param string $alterTemplate The template for the alter instruction
@param callable $executor The function to be used to execute all instructions
@return void
Executes the ALTER instruction and all of the post steps .