Skip to content

Commit

Permalink
refactor(kernel): make Leevel\Kernel\Console\Autoload code clean
Browse files Browse the repository at this point in the history
  • Loading branch information
doyouhaobaby committed Oct 20, 2020
1 parent 538013f commit 074b45f
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions src/Leevel/Kernel/Console/Autoload.php
Expand Up @@ -64,31 +64,15 @@ protected function normalizeComposerCommand(): string
{
$command = sprintf(
'%s dump-autoload --optimize',
escapeshellarg($this->composer())
escapeshellarg((string) $this->getOption('composer'))
);
if (false === $this->dev()) {
if (false === (bool) $this->getOption('dev')) {
$command .= ' --no-dev';
}

return $command;
}

/**
* 取得 Composer 路径.
*/
protected function composer(): string
{
return $this->getOption('composer');
}

/**
* 取得是否为开发模式.
*/
protected function dev(): bool
{
return $this->getOption('dev');
}

/**
* 命令配置.
*/
Expand Down

0 comments on commit 074b45f

Please sign in to comment.