| @@ 303-310 (lines=8) @@ | ||
| 300 | * @return array |
|
| 301 | * @see getEdges() |
|
| 302 | */ |
|
| 303 | public function getCallers( $function ) { |
|
| 304 | $edges = $this->getCompleteMetrics(); |
|
| 305 | if ( isset( $edges[$function]['calls'] ) ) { |
|
| 306 | return array_keys( $edges[$function]['calls'] ); |
|
| 307 | } else { |
|
| 308 | return []; |
|
| 309 | } |
|
| 310 | } |
|
| 311 | ||
| 312 | /** |
|
| 313 | * Get a list of all callees from a given function. |
|
| @@ 319-326 (lines=8) @@ | ||
| 316 | * @return array |
|
| 317 | * @see getEdges() |
|
| 318 | */ |
|
| 319 | public function getCallees( $function ) { |
|
| 320 | $edges = $this->getCompleteMetrics(); |
|
| 321 | if ( isset( $edges[$function]['subcalls'] ) ) { |
|
| 322 | return array_keys( $edges[$function]['subcalls'] ); |
|
| 323 | } else { |
|
| 324 | return []; |
|
| 325 | } |
|
| 326 | } |
|
| 327 | ||
| 328 | /** |
|
| 329 | * Find the critical path for the given metric. |
|