コード例 #1
0
ファイル: ReturnTag.php プロジェクト: williamamed/Raptor2
 /**
  * Initialize the annotation tag.
  */
 protected function initTag()
 {
     parent::initTag();
     $value = preg_split('/[\\s]+/', $this->description, 2);
     if (isset($value[0]) === true && trim($value[0]) !== '') {
         $this->returnType = $value[0];
     }
     if (isset($value[1]) === true && trim($value[1]) !== '') {
         $this->returnDescription = trim($value[1]);
     }
 }
コード例 #2
0
ファイル: ParamTag.php プロジェクト: williamamed/Raptor2
 /**
  * Initialize the annotation tag.
  */
 protected function initTag()
 {
     parent::initTag();
     $value = preg_split('/[\\s]+/', $this->description, 3);
     if (isset($value[0]) === true && trim($value[0]) !== '') {
         $this->paramType = trim($value[0]);
     }
     if (isset($value[1]) === true && trim($value[1]) !== '') {
         $this->paramName = trim($value[1]);
         if (strpos($this->paramName, '$') !== 0) {
             throw new RuntimeException('The name of the parameter does not start with "$".');
         }
     }
     if (isset($value[2]) === true && trim($value[2]) !== '') {
         $this->paramDescription = trim($value[2]);
     }
 }