Exemplo n.º 1
0
 /**
  * Reports the given error
  * 
  * @param PC_Obj_Location $locsrc an object from which the location will be copied (null = current)
  * @param string $msg the error-message
  * @param int $type the error-type
  */
 public function report($locsrc, $msg, $type)
 {
     if (!$locsrc instanceof PC_Obj_Location) {
         FWS_Helper::def_error('instance', 'locsrc', 'PC_Obj_Location', $locsrc);
     }
     $locsrc = new PC_Obj_Location($locsrc->get_file(), $locsrc->get_line());
     $this->errors[] = new PC_Obj_Error($locsrc, $msg, $type);
 }
Exemplo n.º 2
0
 /**
  * Builds an URL to the code for given location.
  *
  * @param PC_Obj_Location $loc the location
  * @return string the URL
  */
 public static function get_code_url($loc)
 {
     $file = $loc->get_file();
     $line = $loc->get_line();
     if ($file) {
         $classes = PC_DAO::get_classes()->get_by_file($file);
         if (count($classes) == 1) {
             $url = PC_URL::get_mod_url('class')->set('name', $classes[0]->get_name());
         } else {
             $url = PC_URL::get_mod_url('file')->set('path', $file);
         }
         $url->set_anchor('l' . $line);
         return $url->to_url();
     }
     return '#';
 }
Exemplo n.º 3
0
 protected function get_dump_vars()
 {
     return array_merge(parent::get_dump_vars(), get_object_vars($this));
 }
Exemplo n.º 4
0
 public function __clone()
 {
     parent::__clone();
     $this->type = clone $this->type;
     $this->arrayref = null;
     $this->arrayoff = null;
 }
Exemplo n.º 5
0
 /**
  * Builds an URL to the given location
  *
  * @param string $classfile the file of the class
  * @param PC_Obj_Location $loc the location of the item
  * @return string the URL
  */
 private function get_url($classfile, $loc)
 {
     if ($loc->get_line() == 0) {
         return $loc->get_file();
     }
     if ($loc->get_file() == $classfile) {
         return '#l' . $loc->get_line();
     }
     return PC_Utils::get_code_url($loc);
 }
Exemplo n.º 6
0
 public function __ToString()
 {
     return '[' . $this->loc->get_file() . ', ' . $this->loc->get_line() . '] #' . $this->type . ' ' . $this->msg;
 }