From bb0835bbf6e15f58d867faa9c2201b946081f7ed Mon Sep 17 00:00:00 2001 From: denisdulici Date: Wed, 20 Nov 2019 11:09:41 +0300 Subject: [PATCH] fixed alias in commands --- src/Commands/InstallCommand.php | 14 +++++++------- src/Commands/MigrationMakeCommand.php | 2 +- src/Commands/SeedCommand.php | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Commands/InstallCommand.php b/src/Commands/InstallCommand.php index eb7cd39..65e6779 100644 --- a/src/Commands/InstallCommand.php +++ b/src/Commands/InstallCommand.php @@ -22,7 +22,7 @@ class InstallCommand extends Command * * @var string */ - protected $description = 'Install the specified module by given package name (vendor/name).'; + protected $description = 'Install the specified module by given package alias (vendor/name).'; /** * Create a new command instance. @@ -37,14 +37,14 @@ public function __construct() */ public function handle() { - if (is_null($this->argument('name'))) { + if (is_null($this->argument('alias'))) { $this->installFromFile(); return; } $this->install( - $this->argument('name'), + $this->argument('alias'), $this->argument('version'), $this->option('type'), $this->option('tree') @@ -70,7 +70,7 @@ protected function installFromFile() $module = collect($module); $this->install( - $module->get('name'), + $module->get('alias'), $module->get('version'), $module->get('type') ); @@ -85,10 +85,10 @@ protected function installFromFile() * @param string $type * @param bool $tree */ - protected function install($name, $version = 'dev-master', $type = 'composer', $tree = false) + protected function install($alias, $version = 'dev-master', $type = 'composer', $tree = false) { $installer = new Installer( - $name, + $alias, $version, $type ?: $this->option('type'), $tree ?: $this->option('tree') @@ -123,7 +123,7 @@ protected function install($name, $version = 'dev-master', $type = 'composer', $ protected function getArguments() { return [ - ['name', InputArgument::OPTIONAL, 'The name of module will be installed.'], + ['alias', InputArgument::OPTIONAL, 'The alias of module will be installed.'], ['version', InputArgument::OPTIONAL, 'The version of module will be installed.'], ]; } diff --git a/src/Commands/MigrationMakeCommand.php b/src/Commands/MigrationMakeCommand.php index f845e3e..15643be 100644 --- a/src/Commands/MigrationMakeCommand.php +++ b/src/Commands/MigrationMakeCommand.php @@ -38,7 +38,7 @@ protected function getArguments() { return [ ['name', InputArgument::REQUIRED, 'The migration name will be created.'], - ['module', InputArgument::OPTIONAL, 'The name of module will be created.'], + ['alias', InputArgument::OPTIONAL, 'The alias of module will be created.'], ]; } diff --git a/src/Commands/SeedCommand.php b/src/Commands/SeedCommand.php index 0db4859..13d8eb3 100644 --- a/src/Commands/SeedCommand.php +++ b/src/Commands/SeedCommand.php @@ -100,7 +100,7 @@ public function moduleSeed(Module $module) $config = $module->get('migration'); if (is_array($config) && array_key_exists('seeds', $config)) { - foreach ((array)$config['seeds'] as $class) { + foreach ((array) $config['seeds'] as $class) { if (class_exists($class)) { $seeders[] = $class; }