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:
@@ -22,6 +22,11 @@ final class DivinerPHPAtomizer extends DivinerAtomizer {
|
|||||||
|
|
||||||
$name = $func->getChildByIndex(2);
|
$name = $func->getChildByIndex(2);
|
||||||
|
|
||||||
|
// Don't atomize closures
|
||||||
|
if ($name->getTypeName() === 'n_EMPTY') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$atom = $this->newAtom(DivinerAtom::TYPE_FUNCTION)
|
$atom = $this->newAtom(DivinerAtom::TYPE_FUNCTION)
|
||||||
->setName($name->getConcreteString())
|
->setName($name->getConcreteString())
|
||||||
->setLine($func->getLineNumber())
|
->setLine($func->getLineNumber())
|
||||||
|
|||||||
Reference in New Issue
Block a user