mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-17 20:32:41 +01:00
Skip anon functions in symbol generation script
Summary: Filters closures out of symbol generator script, per @epriestley's comment in T4334 Test Plan: Before: eric@eric-dev ~/phabricator/scripts/symbols: echo 'closure.php' | ./generate_php_symbols.php function php /closure.php d function php 10 /closure.php function php /closure.php a class php 3 /closure.php a b method php 4 /closure.php After: eric@eric-dev ~/phabricator/scripts/symbols: echo 'closure.php' | ./generate_php_symbols.php d function php 10 /closure.php a class php 3 /closure.php a b method php 4 /closure.php eric@eric-dev ~/phabricator/scripts/symbols: cat closure.php <?php class a { function b() { $c = function() { return 1; }; $c(); } } function d() { return 2; } $e = function() { return 3; }; Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley CC: epriestley, Korvin, aran Differential Revision: https://secure.phabricator.com/D8054
This commit is contained in:
parent
febc494737
commit
14f070a0af
1 changed files with 4 additions and 0 deletions
|
@ -34,6 +34,10 @@ foreach (Futures($futures)->limit(8) as $file => $future) {
|
|||
$functions = $root->selectDescendantsOfType('n_FUNCTION_DECLARATION');
|
||||
foreach ($functions as $function) {
|
||||
$name = $function->getChildByIndex(2);
|
||||
// Skip anonymous functions
|
||||
if (!$name->getConcreteString()) {
|
||||
continue;
|
||||
}
|
||||
print_symbol($file, 'function', $name);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue