示例#1
0
文件: HelpOption.php 项目: alxmsl/cli
 /**
  * @param string $description description of option. Default value is empty
  */
 public function __construct($description = '')
 {
     parent::__construct('help', 'h', $description);
 }
 public function __construct($strQcClass, $name, $origName, $jsType, $description, $phpType = null)
 {
     parent::__construct($name, $origName, $jsType, 'null', $description, $phpType);
     if (strpos($name, 'on') === 0) {
         $name = substr($name, 2);
     }
     if (stripos($jsType, 'function') === 0) {
         $subject = substr($jsType, 8);
         $subject = trim($subject, '()');
         $this->arrArgs = array();
         foreach (explode(',', $subject) as $arg) {
             $arg = trim($arg);
             $arg = preg_replace('/.*\\s/', '', $arg);
             $this->arrArgs[] = $arg;
         }
         $this->eventName = $strQcClass . '_' . $name;
     } else {
         $this->eventName = $jsType;
     }
     $this->eventClassName = $strQcClass . '_' . $name . 'Event';
 }