Changeset View
Changeset View
Standalone View
Standalone View
support/lib/extract-symbols.php
Context not available. | |||||
$attributes = $possible_trait->getChildByIndex(0); | $attributes = $possible_trait->getChildByIndex(0); | ||||
// Can't use getChildByIndex here because not all classes have attributes | // Can't use getChildByIndex here because not all classes have attributes | ||||
foreach ($attributes->getChildren() as $attribute) { | foreach ($attributes->getChildren() as $attribute) { | ||||
if (strtolower($attribute->getConcreteString()) === 'trait') { | if (@strtolower($attribute->getConcreteString()) === 'trait') { | ||||
phutil_fail_on_unsupported_feature($possible_trait, $path, pht('traits')); | phutil_fail_on_unsupported_feature($possible_trait, $path, pht('traits')); | ||||
} | } | ||||
} | } | ||||
Context not available. | |||||
foreach ($ext_list as $ext_ref) { | foreach ($ext_list as $ext_ref) { | ||||
$matches = null; | $matches = null; | ||||
if (preg_match('/^\s*(\S+)\s+(\S+)/', $ext_ref, $matches)) { | if (@preg_match('/^\s*(\S+)\s+(\S+)/', $ext_ref, $matches)) { | ||||
$externals[$matches[1]][$matches[2]] = true; | $externals[$matches[1]][$matches[2]] = true; | ||||
} | } | ||||
} | } | ||||
Context not available. | |||||
$symbol = array_shift($params); | $symbol = array_shift($params); | ||||
$type = 'function'; | $type = 'function'; | ||||
$symbol_value = $symbol->getStringLiteralValue(); | $symbol_value = $symbol->getStringLiteralValue(); | ||||
$pos = strpos($symbol_value, '::'); | $pos = @strpos($symbol_value, '::'); | ||||
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) {} | ||||
} | } | ||||
if ($symbol_value && strpos($symbol_value, '$') === false) { | if ($symbol_value && @strpos($symbol_value, '$') === false) { | ||||
$need[] = array( | $need[] = array( | ||||
'type' => $type, | 'type' => $type, | ||||
'name' => $symbol_value, | 'name' => $symbol_value, | ||||
Context not available. | |||||
} | } | ||||
$symbol = reset($params); | $symbol = reset($params); | ||||
$symbol_value = $symbol->getStringLiteralValue(); | $symbol_value = $symbol->getStringLiteralValue(); | ||||
if ($symbol_value && strpos($symbol_value, '$') === false) { | if ($symbol_value && @strpos($symbol_value, '$') === false) { | ||||
$need[] = array( | $need[] = array( | ||||
'type' => 'class', | 'type' => 'class', | ||||
'name' => $symbol_value, | 'name' => $symbol_value, | ||||
Context not available. | |||||
} | } | ||||
$type = $spec['type']; | $type = $spec['type']; | ||||
foreach (explode('/', $type) as $libtype) { | foreach (@explode('/', $type) as $libtype) { | ||||
if (!$show_all) { | if (!$show_all) { | ||||
if (!empty($externals[$libtype][$name])) { | if (!empty($externals[$libtype][$name])) { | ||||
// Ignore symbols declared as externals. | // Ignore symbols declared as externals. | ||||
Context not available. |
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