| @@ 170-191 (lines=22) @@ | ||
| 167 | /** |
|
| 168 | * @inheritdocs |
|
| 169 | */ |
|
| 170 | public function _method_reference($name, $file, $line, $column) { |
|
| 171 | assert('is_string($name)'); |
|
| 172 | assert('$file->type() == "file"'); |
|
| 173 | assert('is_int($line)'); |
|
| 174 | ||
| 175 | $key = $name."_".$file->property("path")."_".$line."_".$column; |
|
| 176 | ||
| 177 | if (array_key_exists($key, $this->method_references)) { |
|
| 178 | return $this->method_references[$key]; |
|
| 179 | } |
|
| 180 | ||
| 181 | $method = $this->create_node("method reference", ["name" => $name]); |
|
| 182 | $this->add_relation |
|
| 183 | ( $method |
|
| 184 | , "referenced at" |
|
| 185 | , ["line" => $line, "column" => $column] |
|
| 186 | , $file |
|
| 187 | ); |
|
| 188 | ||
| 189 | $this->method_references[$key] = $method; |
|
| 190 | return $method; |
|
| 191 | } |
|
| 192 | ||
| 193 | /** |
|
| 194 | * @inheritdocs |
|
| @@ 196-217 (lines=22) @@ | ||
| 193 | /** |
|
| 194 | * @inheritdocs |
|
| 195 | */ |
|
| 196 | public function _function_reference($name, $file, $line, $column) { |
|
| 197 | assert('is_string($name)'); |
|
| 198 | assert('$file->type() == "file"'); |
|
| 199 | assert('is_int($line)'); |
|
| 200 | ||
| 201 | $key = $name."_".$file->property("path")."_".$line."_".$column; |
|
| 202 | ||
| 203 | if (array_key_exists($key, $this->function_references)) { |
|
| 204 | return $this->function_references[$key]; |
|
| 205 | } |
|
| 206 | ||
| 207 | $function = $this->create_node("function reference", ["name" => $name]); |
|
| 208 | $this->add_relation |
|
| 209 | ( $function |
|
| 210 | , "referenced at" |
|
| 211 | , ["line" => $line, "column" => $column] |
|
| 212 | , $file |
|
| 213 | ); |
|
| 214 | ||
| 215 | $this->function_references[$key] = $function; |
|
| 216 | return $function; |
|
| 217 | } |
|
| 218 | ||
| 219 | /** |
|
| 220 | * @inheritdocs |
|