Example #1
0
 /**
  * Parses the type of a class-constant from the given phpdoc
  *
  * @param PC_Obj_Constant $const the constant
  */
 public function parse_const_doc($const)
 {
     if (isset($this->constComments[$const->get_name()])) {
         // if we already know the value, we don't have to use the phpdoc
         // TODO we could issue a warning here if the type differs
         if ($const->get_type()->is_unknown()) {
             $type = $this->parse_var_from($this->constComments[$const->get_name()]);
             if ($type !== null) {
                 $const->set_type($type);
             }
         }
         unset($this->constComments[$const->get_name()]);
     }
 }