/**
  * @param Command $command
  *
  * @return string
  */
 public function generate(Command $command)
 {
     $origMethodName = $command->getMethod() ?: $command->getName();
     $methodNameParts = explode('-', $origMethodName);
     $methodNameStart = array_shift($methodNameParts);
     $methodNameEnd = implode('', array_map('ucfirst', $methodNameParts));
     return $methodNameStart . $methodNameEnd . 'Cmd';
 }
示例#2
0
 public function testCommand()
 {
     $cmd = new Command('cmd', 'description', ['cmd1', 'cmd2'], true, 'cmdMethod');
     $this->assertSame('cmd', $cmd->getName());
     $this->assertSame('description', $cmd->getDescription());
     $this->assertSame(['cmd1', 'cmd2'], $cmd->getAliases());
     $this->assertTrue($cmd->isDefault());
     $this->assertSame('cmdMethod', $cmd->getMethod());
 }