src/Command/Create.php
private function getMigrationFileContents($class_name)
    {
        $namespace = $this->getNamespace();

        $contents = [
            '<?php',
            '',
        ];

        if ($header_comment = $this->getHeaderComment()) {
            $contents[] = '/*';
            $contents = array_merge($contents, array_map(function ($line) {
                if ($line) {
                    return ' * ' . $line;
                } else {
                    return ' *';
                }
            }, explode("\n", $header_comment)));
            $contents[] = ' */';
            $contents[] = '';
        }

        if ($namespace) {
            $contents[] = 'namespace ' . $namespace . ';';
            $contents[] = '';
        }

        $contents[] = 'use ActiveCollab\DatabaseMigrations\Migration\Migration;';
        $contents[] = '';

        if ($namespace) {
            $contents[] = '/**';
            $contents[] = ' * @package ' . $namespace;
            $contents[] = ' */';
        }

        $contents[] = 'class ' . $class_name . ' extends Migration';
        $contents[] = '{';
        $contents[] = '    /**';
        $contents[] = '     * {@inheritdoc}';
        $contents[] = '     */';
        $contents[] = '    public function up()';
        $contents[] = '    {';
        $contents[] = '    }';
        $contents[] = '}';
        $contents[] = '';

        return implode("\n", $contents);
    }
private function getMigrationFileContents($class_name)
    {
        $namespace = $this->getNamespace();

        $contents = [
            '<?php',
            '',
        ];

        if ($header_comment = $this->getHeaderComment()) {
            $contents[] = '/*';
            $contents = array_merge($contents, array_map(function ($line) {
                if ($line) {
                    return ' * ' . $line;
                } else {
                    return ' *';
                }
            }, explode("\n", $header_comment)));
            $contents[] = ' */';
            $contents[] = '';
        }

        if ($namespace) {
            $contents[] = 'namespace ' . $namespace . ';';
            $contents[] = '';
        }

        $contents[] = 'use ActiveCollab\DatabaseMigrations\Migration\Migration;';
        $contents[] = '';

        if ($namespace) {
            $contents[] = '/**';
            $contents[] = ' * @package ' . $namespace;
            $contents[] = ' */';
        }

        $contents[] = 'class ' . $class_name . ' extends Migration';
        $contents[] = '{';
        $contents[] = '    /**';
        $contents[] = '     * {@inheritdoc}';
        $contents[] = '     */';
        $contents[] = '    public function up()';
        $contents[] = '    {';
        $contents[] = '    }';
        $contents[] = '}';
        $contents[] = '';

        return implode("\n", $contents);
    }
private function getMigrationFileContents ( $ class_name ) { $ namespace = $ this -> getNamespace ( ) ; $ contents = [ '<?php' , '' , ] ; if ( $ header_comment = $ this -> getHeaderComment ( ) ) { $ contents [ ] = '/*' ; $ contents = array_merge ( $ contents , array_map ( function ( $ line ) { if ( $ line ) { return ' * ' . $ line ; } else { return ' *' ; } } , explode ( "\n" , $ header_comment ) ) ) ; $ contents [ ] = ' */' ; $ contents [ ] = '' ; } if ( $ namespace ) { $ contents [ ] = 'namespace ' . $ namespace . ';' ; $ contents [ ] = '' ; } $ contents [ ] = 'use ActiveCollab\DatabaseMigrations\Migration\Migration;' ; $ contents [ ] = '' ; if ( $ namespace ) { $ contents [ ] = '/**' ; $ contents [ ] = ' * @package ' . $ namespace ; $ contents [ ] = ' */' ; } $ contents [ ] = 'class ' . $ class_name . ' extends Migration' ; $ contents [ ] = '{' ; $ contents [ ] = '    /**' ; $ contents [ ] = '     * {@inheritdoc}' ; $ contents [ ] = '     */' ; $ contents [ ] = '    public function up()' ; $ contents [ ] = '    {' ; $ contents [ ] = '    }' ; $ contents [ ] = '}' ; $ contents [ ] = '' ; return implode ( "\n" , $ contents ) ; }
Generate migration class contents.

@param  string $class_name
@return string
Generate migration class contents .