GetOptionKit\Option::getId PHP Method

getId() public method

* get the option key for result key mapping.
public getId ( )
    public function getId()
    {
        return $this->key ?: $this->long ?: $this->short;
    }

Usage Example

コード例 #1
0
 /**
  * Add option object
  *
  * @param Object $spec the option object.
  */
 public function addObject(Option $spec)
 {
     $this->data[$spec->getId()] = $spec;
     if ($spec->long) {
         $this->longOptions[$spec->long] = $spec;
     }
     if ($spec->short) {
         $this->shortOptions[$spec->short] = $spec;
     }
     $this->options[] = $spec;
     if (!$spec->long && !$spec->short) {
         throw new Exception('Wrong option spec');
     }
 }
All Usage Examples Of GetOptionKit\Option::getId