/** * Ask for a parameter's value * * @param Parameter $parameter * @param InputInterface $input * @param OutputInterface $output * @return array[string]string the parameter set as a key/value hash for use in a generator **/ public function askParameter(Parameter $parameter, InputInterface $input, OutputInterface $output) { if ($parameter->hasDefaultValue()) { $question = new Question($parameter->getDescription(), $parameter->getDefaultValue()); } else { $question = new Question($parameter->getDescription()); } return $this->getQuestionHelper()->ask($input, $output, $question); }
/** * no description given test * * @return void **/ public function testConstructWithoutDescription() { $param = new Parameter('foo'); $this->assertEquals('foo', $param->getName()); $this->assertEquals('foo', $param->getDescription()); }