Skip to content

Can't call run() method with params from migrate:latest  #1308

Description

@HieuPT7

name: Bug report
about: Can't call run() method with params from migrate:latest

Describe the bug


<?php namespace App\Commands;

use CodeIgniter\CLI\CLI;
use CodeIgniter\CLI\BaseCommand;

class Module extends BaseCommand
{
    /**
     * A heading this command is grouped under
     * when listed via `php spark`
     */
    protected $group = 'Modules';

    /**
     * The Command's name
     *
     * @var string
     */
    protected $name = 'module';

    /**
     * The Command's short description
     *
     * @var string
     */
    protected $description = '';

    /**
     * The main entry point into the command.
     * All base logic should happen here.
     */
    public function run(array $params=[])
    {
        $name = array_shift($params);
        $this->call('migrate:latest', ['-n' => 'Modules\\'.$name.'']);
    }
}

I debug variable $namespace in \CodeIgniter\Commands\Database\MigrateLatest line 107 then it is null.
I think variable $params has not been used yet.

CodeIgniter 4 version
4.0.0 alpha.1

Affected module(s)
\CodeIgniter\Commands\Database\MigrateLatest

Context

  • OS: macOS High Sierra 10.13.6
  • Web server: apache
  • PHP version 7.1.12

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions