Changeset View
Changeset View
Standalone View
Standalone View
support/lib/extract-symbols.php
Show First 20 Lines • Show All 213 Lines • ▼ Show 20 Lines | if ($call_name === 'call_user_func' || | ||||
$params = $call->getChildByIndex(1)->getChildren(); | $params = $call->getChildByIndex(1)->getChildren(); | ||||
if (!count($params)) { | if (!count($params)) { | ||||
// This is a bare call_user_func() with no arguments; just ignore it. | // This is a bare call_user_func() with no arguments; just ignore it. | ||||
continue; | continue; | ||||
} | } | ||||
$symbol = array_shift($params); | $symbol = array_shift($params); | ||||
$type = 'function'; | $type = 'function'; | ||||
$symbol_value = $symbol->getStringLiteralValue(); | $symbol_value = $symbol->getStringLiteralValue(); | ||||
if ($symbol_value !== null) { | |||||
$pos = strpos($symbol_value, '::'); | $pos = strpos($symbol_value, '::'); | ||||
} else { | |||||
$pos = false; | |||||
} | |||||
if ($pos) { | if ($pos) { | ||||
$type = 'class'; | $type = 'class'; | ||||
$symbol_value = substr($symbol_value, 0, $pos); | $symbol_value = substr($symbol_value, 0, $pos); | ||||
} else if ($symbol->getTypeName() === 'n_ARRAY_LITERAL') { | } else if ($symbol->getTypeName() === 'n_ARRAY_LITERAL') { | ||||
try { | try { | ||||
$type = 'class'; | $type = 'class'; | ||||
$symbol_value = idx($symbol->evalStatic(), 0); | $symbol_value = idx($symbol->evalStatic(), 0); | ||||
} catch (Exception $ex) {} | } catch (Exception $ex) {} | ||||
▲ Show 20 Lines • Show All 379 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0