private function generateCommand($name, \ReflectionMethod $method, $token = null)
    {
        $methodName = $this->transformer->transform($method->getName());

        $command = new Command(strtolower($name . ':' . $methodName));

        $factory  = DocBlockFactory::createInstance();
        $docBlock = $factory->create($method);

        $command->setDefinition($this->buildDefinition($method, $docBlock, $token));
        $command->setDescription($docBlock->getSummary());
        $command->setCode($this->createCode($name, $method));

        return $command;
    }