1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

In Diviner, parse "abstract" and "final" in PHP classes, interfaces and methods

Summary: Ref T988. Adds support for the "abstract" and "final" keywords in the atomizer.

Test Plan: Looked at abstract/final stuff.

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T988

Differential Revision: https://secure.phabricator.com/D6850
This commit is contained in:
epriestley 2013-08-30 09:19:18 -07:00
parent bf50e0f870
commit 1b6f71dec1

View file

@ -49,7 +49,11 @@ final class DivinerPHPAtomizer extends DivinerAtomizer {
->setFile($file_name) ->setFile($file_name)
->setLine($class->getLineNumber()); ->setLine($class->getLineNumber());
// TODO: Parse "abstract" and "final". // This parses "final" and "abstract".
$attributes = $class->getChildByIndex(0, 'n_CLASS_ATTRIBUTES');
foreach ($attributes->selectDescendantsOfType('n_STRING') as $attr) {
$atom->setProperty($attr->getConcreteString(), true);
}
// If this exists, it is n_EXTENDS_LIST. // If this exists, it is n_EXTENDS_LIST.
$extends = $class->getChildByIndex(2); $extends = $class->getChildByIndex(2);