Skip to content

Commit

Permalink
fixed alias in commands
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed Nov 20, 2019
1 parent 7a10bd6 commit bb0835b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions src/Commands/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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')
Expand All @@ -70,7 +70,7 @@ protected function installFromFile()
$module = collect($module);

$this->install(
$module->get('name'),
$module->get('alias'),
$module->get('version'),
$module->get('type')
);
Expand All @@ -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')
Expand Down Expand Up @@ -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.'],
];
}
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/MigrationMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.'],
];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Commands/SeedCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit bb0835b

Please sign in to comment.