Skip to content

Commit

Permalink
feat(plugin): g:plugin 标题为空时根据插件 id 生成标题,id 传入 snake 格式时转换为 dash 格式
Browse files Browse the repository at this point in the history
  • Loading branch information
twinh committed May 10, 2024
1 parent 27e1836 commit f71bbee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Command/GPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ protected function configure()
*/
protected function handle()
{
$dashId = $this->str->dash($this->getArgument('id'));
$camelId = $this->str->camel($dashId);
$camelId = $this->str->camel($this->getArgument('id'));
$dashId = $this->str->dash($camelId);
$pascalId = ucfirst($camelId);

$name = $this->getArgument('name');
$name = $this->getArgument('name') ?: ucwords(strtr($dashId, '-', ' '));

if ($this->plugin->has($dashId)) {
return $this->err(sprintf('Plugin "%s" exists', $dashId));
Expand Down

0 comments on commit f71bbee

Please sign in to comment.