src/Migration/Creator/MigrationCreator.php
protected function getStubs(?string $table = null, bool $create = false): iterable
    {
        if (is_null($table)) {
            yield M::TYPE_UP => $this->stubs->read('blank.sql.stub');
            yield M::TYPE_DOWN => $this->stubs->read('blank.sql.stub');
            return;
        }

        $first = [M::TYPE_UP => 'create.sql.stub', M::TYPE_DOWN => 'down.sql.stub'];
        $second = [M::TYPE_UP => 'update.sql.stub', M::TYPE_DOWN => 'update.sql.stub'];

        $stubs = $create ? $first : $second;

        foreach ($stubs as $type => $stub) {
            yield $type => $this->stubs->read($stub);
        }
    }
protected function getStubs(?string $table = null, bool $create = false): iterable
    {
        if (is_null($table)) {
            yield M::TYPE_UP => $this->stubs->read('blank.sql.stub');
            yield M::TYPE_DOWN => $this->stubs->read('blank.sql.stub');
            return;
        }

        $first = [M::TYPE_UP => 'create.sql.stub', M::TYPE_DOWN => 'down.sql.stub'];
        $second = [M::TYPE_UP => 'update.sql.stub', M::TYPE_DOWN => 'update.sql.stub'];

        $stubs = $create ? $first : $second;

        foreach ($stubs as $type => $stub) {
            yield $type => $this->stubs->read($stub);
        }
    }
protected function getStubs ( ? string $ table = null , bool $ create = false ) : iterable { if ( is_null ( $ table ) ) { yield M :: TYPE_UP => $ this -> stubs -> read ( 'blank.sql.stub' ) ; yield M :: TYPE_DOWN => $ this -> stubs -> read ( 'blank.sql.stub' ) ; return ; } $ first = [ M :: TYPE_UP => 'create.sql.stub' , M :: TYPE_DOWN => 'down.sql.stub' ] ; $ second = [ M :: TYPE_UP => 'update.sql.stub' , M :: TYPE_DOWN => 'update.sql.stub' ] ; $ stubs = $ create ? $ first : $ second ; foreach ( $ stubs as $ type => $ stub ) { yield $ type => $ this -> stubs -> read ( $ stub ) ; } }
Get the migration stub file.

@param  string $table
@param  bool $create
@return iterable
@throws \League\Flysystem\FileNotFoundException
Get the migration stub file .