| @@ 207-228 (lines=22) @@ | ||
| 204 | /** |
|
| 205 | * @inheritdocs |
|
| 206 | */ |
|
| 207 | public function _method_reference($name, $file, $line, $column) { |
|
| 208 | assert('is_string($name)'); |
|
| 209 | assert('$file->type() == "file"'); |
|
| 210 | assert('is_int($line)'); |
|
| 211 | ||
| 212 | $key = $name."_".$file->property("path")."_".$line."_".$column; |
|
| 213 | ||
| 214 | if (array_key_exists($key, $this->method_references)) { |
|
| 215 | return $this->method_references[$key]; |
|
| 216 | } |
|
| 217 | ||
| 218 | $method = $this->create_node("method reference", ["name" => $name]); |
|
| 219 | $this->add_relation |
|
| 220 | ( $method |
|
| 221 | , "referenced at" |
|
| 222 | , ["line" => $line, "column" => $column] |
|
| 223 | , $file |
|
| 224 | ); |
|
| 225 | ||
| 226 | $this->method_references[$key] = $method; |
|
| 227 | return $method; |
|
| 228 | } |
|
| 229 | ||
| 230 | /** |
|
| 231 | * @inheritdocs |
|
| @@ 233-254 (lines=22) @@ | ||
| 230 | /** |
|
| 231 | * @inheritdocs |
|
| 232 | */ |
|
| 233 | public function _function_reference($name, $file, $line, $column) { |
|
| 234 | assert('is_string($name)'); |
|
| 235 | assert('$file->type() == "file"'); |
|
| 236 | assert('is_int($line)'); |
|
| 237 | ||
| 238 | $key = $name."_".$file->property("path")."_".$line."_".$column; |
|
| 239 | ||
| 240 | if (array_key_exists($key, $this->function_references)) { |
|
| 241 | return $this->function_references[$key]; |
|
| 242 | } |
|
| 243 | ||
| 244 | $function = $this->create_node("function reference", ["name" => $name]); |
|
| 245 | $this->add_relation |
|
| 246 | ( $function |
|
| 247 | , "referenced at" |
|
| 248 | , ["line" => $line, "column" => $column] |
|
| 249 | , $file |
|
| 250 | ); |
|
| 251 | ||
| 252 | $this->function_references[$key] = $function; |
|
| 253 | return $function; |
|
| 254 | } |
|
| 255 | ||
| 256 | /** |
|
| 257 | * @inheritdocs |
|