getDescription() 공개 메소드

Returns the description text.
public getDescription ( ) : string
리턴 string The description text.
예제 #1
0
 /**
  * Renders an argument.
  *
  * @param BlockLayout $layout   The layout.
  * @param Argument    $argument The argument to render.
  */
 protected function renderArgument(BlockLayout $layout, Argument $argument)
 {
     $description = $argument->getDescription();
     $name = '<c1><' . $argument->getName() . '></c1>';
     $defaultValue = $argument->getDefaultValue();
     if (null !== $defaultValue && (!is_array($defaultValue) || count($defaultValue))) {
         $description .= sprintf(' <b>(default: %s)</b>', $this->formatValue($defaultValue));
     }
     $layout->add(new LabeledParagraph($name, $description));
 }
 /**
  * Creates an input argument for the given argument.
  *
  * @param Argument $argument The argument.
  *
  * @return InputArgument The created input argument.
  */
 private function adaptArgument(Argument $argument)
 {
     $mode = null;
     if ($argument->isMultiValued()) {
         $mode |= InputArgument::IS_ARRAY;
     }
     if ($argument->isOptional()) {
         $mode |= InputArgument::OPTIONAL;
     }
     if ($argument->isRequired()) {
         $mode |= InputArgument::REQUIRED;
     }
     return new InputArgument($argument->getName(), $mode, $argument->getDescription(), $argument->getDefaultValue());
 }
예제 #3
0
 public function testSetDescription()
 {
     $argument = new Argument('argument', 0, 'Description');
     $this->assertSame('Description', $argument->getDescription());
 }