- Query what source code files exist in the codebase
- Query what classes/traits/interfaces exist. eg. $index->getClasses() returns fully qualified list of class names
- Query what functions exist. eg. $index->getFunctions() returns fully qualified list of function names
- On a class/trait/interface can find what methods/properties/constants exist
- On a class/interface can inspect the parent class/interface
- On a class/trait inspect what interfaces are implemented
- For a class find subclasses
- For a trait find trait usages
- For an interface find class/traits that implement the interface
- For an interface find interfaces which extend it
- For a class/trait find methods/properties, including methods/properties defined by a parent class
- For a method/function find usages
- When a file is removed any usages/classes/functions/traits/interfaces are removed from index
- Magic methods/properties defined by @method and @property should be supported
From indexer will built a static checker that does the following:
- Checks that referenced class/trait/interface exists
- Checks that a method/property exists on class/interface when used
- Notify of dead code
- Check for undefined variables (indicates possible typos)
- Checks correct parameters are given to function/methods/constructors
Here are the test methods I've sketched in based on this gist: