/** * Default value `null` * * @return void **/ public function testNullValue() { $param = new Parameter('foo'); $param->setDefaultValue(null); $this->assertTrue($param->hasDefaultValue()); $this->assertEquals(null, $param->getDefaultValue()); }
/** * 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); }