Exemple #1
0
 /**
  * Builds the fields to insert for the given call and project
  * 
  * @param PC_Obj_Call $call the call
  * @param PC_Project $project the project
  * @return array an associative array with the fields
  */
 private function build_fields($call, $project)
 {
     $args = serialize($call->get_arguments());
     if (strlen($args) > self::MAX_ARGS_LEN) {
         $arglist = array();
         foreach ($call->get_arguments() as $arg) {
             $arg->clear_values();
             $arglist[] = $arg;
         }
         $args = serialize($arglist);
     }
     return array('project_id' => $project !== null ? $project->get_id() : 0, 'file' => $call->get_file(), 'line' => $call->get_line(), 'function' => $call->get_function(), 'class' => $call->get_class() === null ? null : $call->get_class(), 'static' => $call->is_static() ? 1 : 0, 'objcreation' => $call->is_object_creation() ? 1 : 0, 'arguments' => $args);
 }
Exemple #2
0
 /**
  * Builds a link for the given call
  *
  * @param PC_Obj_Call $call the call
  * @return string the link
  */
 private function get_call_link($call)
 {
     $str = '';
     if ($call->get_class()) {
         $str .= '#' . $call->get_class() . '#';
         if ($call->is_static()) {
             $str .= '::';
         } else {
             $str .= '->';
         }
     }
     $str .= $call->get_function() . '(' . implode(', ', $call->get_arguments()) . ')';
     return $str;
 }