mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-27 07:50:57 +01:00
Don't atomize closures
Summary: In a PHP5.3+ codebase with closures, Diviner would pick up anonymous functions and add them into the generated documentation. This causes them to be skipped. Test Plan: Ran `bin/diviner generate --clean` before and after change, no longer got a bunch of unnamed functions dumped into the documentation. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D9786
This commit is contained in:
parent
7304e29dec
commit
ede6947dd1
1 changed files with 5 additions and 0 deletions
|
@ -22,6 +22,11 @@ final class DivinerPHPAtomizer extends DivinerAtomizer {
|
|||
|
||||
$name = $func->getChildByIndex(2);
|
||||
|
||||
// Don't atomize closures
|
||||
if ($name->getTypeName() === 'n_EMPTY') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$atom = $this->newAtom(DivinerAtom::TYPE_FUNCTION)
|
||||
->setName($name->getConcreteString())
|
||||
->setLine($func->getLineNumber())
|
||||
|
|
Loading…
Reference in a new issue