Xhgui_Profile::_getChildren PHP Method

_getChildren() protected method

Find symbols that are the children of the given name.
protected _getChildren ( string $symbol, string $metric = null, float $threshold ) : array
$symbol string The name of the function to find children of.
$metric string The metric to compare $threshold with.
$threshold float The threshold to exclude functions at. Any function that represents less than
return array An array of child methods.
    protected function _getChildren($symbol, $metric = null, $threshold = 0)
    {
        $children = array();
        if (!isset($this->_indexed[$symbol])) {
            return $children;
        }
        $total = 0;
        if (isset($metric)) {
            $top = $this->_indexed[self::NO_PARENT];
            // Not always 'main()'
            $mainFunc = current($top);
            $total = $mainFunc[$metric];
        }
        foreach ($this->_indexed[$symbol] as $name => $data) {
            if ($metric && $total > 0 && $threshold > 0 && $this->_collapsed[$name][$metric] / $total < $threshold) {
                continue;
            }
            $children[] = $data + array('function' => $name);
        }
        return $children;
    }