src/Phinx/Db/Plan/Plan.php
protected function gatherCreates($actions)
    {
        collection($actions)
            ->filter(function ($action) {
                return $action instanceof CreateTable;
            })
            ->map(function ($action) {
                return [$action->getTable()->getName(), new NewTable($action->getTable())];
            })
            ->each(function ($step) {
                $this->tableCreates[$step[0]] = $step[1];
            });

        collection($actions)
            ->filter(function ($action) {
                return $action instanceof AddColumn
                    || $action instanceof AddIndex;
            })
            ->filter(function ($action) {
                return isset($this->tableCreates[$action->getTable()->getName()]);
            })
            ->each(function ($action) {
                $table = $action->getTable();

                if ($action instanceof AddColumn) {
                    $this->tableCreates[$table->getName()]->addColumn($action->getColumn());
                }

                if ($action instanceof AddIndex) {
                    $this->tableCreates[$table->getName()]->addIndex($action->getIndex());
                }
            });
    }
protected function gatherCreates($actions)
    {
        collection($actions)
            ->filter(function ($action) {
                return $action instanceof CreateTable;
            })
            ->map(function ($action) {
                return [$action->getTable()->getName(), new NewTable($action->getTable())];
            })
            ->each(function ($step) {
                $this->tableCreates[$step[0]] = $step[1];
            });

        collection($actions)
            ->filter(function ($action) {
                return $action instanceof AddColumn
                    || $action instanceof AddIndex;
            })
            ->filter(function ($action) {
                return isset($this->tableCreates[$action->getTable()->getName()]);
            })
            ->each(function ($action) {
                $table = $action->getTable();

                if ($action instanceof AddColumn) {
                    $this->tableCreates[$table->getName()]->addColumn($action->getColumn());
                }

                if ($action instanceof AddIndex) {
                    $this->tableCreates[$table->getName()]->addIndex($action->getIndex());
                }
            });
    }
protected function gatherCreates ( $ actions ) { collection ( $ actions ) -> filter ( function ( $ action ) { return $ action instanceof CreateTable ; } ) -> map ( function ( $ action ) { return [ $ action -> getTable ( ) -> getName ( ) , new NewTable ( $ action -> getTable ( ) ) ] ; } ) -> each ( function ( $ step ) { $ this -> tableCreates [ $ step [ 0 ] ] = $ step [ 1 ] ; } ) ; collection ( $ actions ) -> filter ( function ( $ action ) { return $ action instanceof AddColumn || $ action instanceof AddIndex ; } ) -> filter ( function ( $ action ) { return isset ( $ this -> tableCreates [ $ action -> getTable ( ) -> getName ( ) ] ) ; } ) -> each ( function ( $ action ) { $ table = $ action -> getTable ( ) ; if ( $ action instanceof AddColumn ) { $ this -> tableCreates [ $ table -> getName ( ) ] -> addColumn ( $ action -> getColumn ( ) ) ; } if ( $ action instanceof AddIndex ) { $ this -> tableCreates [ $ table -> getName ( ) ] -> addIndex ( $ action -> getIndex ( ) ) ; } } ) ; }
Collects all table creation actions from the given intent

@param \Phinx\Db\Action\Action[] $actions The actions to parse
@return void
Collects all table creation actions from the given intent