Пример #1
0
 /**
  * Gets the option names as a formatted string
  *
  * @param Option $option The option to convert to text
  * @return string The option names as text
  */
 private function getOptionNames(Option $option)
 {
     $optionNames = "--{$option->getName()}";
     if ($option->getShortName() !== null) {
         $optionNames .= "|-{$option->getShortName()}";
     }
     return $optionNames;
 }
Пример #2
0
 /**
  * Formats an option
  *
  * @param Option $option The option to format
  * @return string The formatted option
  */
 private function formatOption(Option $option)
 {
     $text = "[--{$option->getName()}";
     if ($option->valueIsOptional()) {
         $text .= "=" . $option->getDefaultValue();
     }
     if ($option->getShortName() !== null) {
         $text .= "|-{$option->getShortName()}";
     }
     $text .= "]";
     return $text;
 }