I encountered an issue with MediaWiki-extensions-LdapAuthentication and took that as an excuse to finally have a look at phan.
I have thus cloned mediawiki/extensions/LdapAuthentication and followed the wiki tutorial https://www.mediawiki.org/wiki/Continuous_integration/Tutorials/Add_phan_to_a_MediaWiki_extension
The various php files at the root of the repository are not processed when using phan -d . -p and have .phan/config.php using vendor/mediawiki/mediawiki-phan-config/src/config.php.
- -d . tells it to analyze the current directory
That is misleading. From phan 1.2.4 help:
-d, --project-root-directory </path/to/project>
Hunt for a directory named .phan in the provided directory and read configuration file .phan/config.php from that path.
Hence -d seems to be solely to find the config file.
I had to use:
-l, --directory <directory>
A directory that should be parsed for class and method information. After excluding the directories defined in --exclude-directory-list, the remaining files will be statically analyzed for errors.
Thus, both first-party and third-party code being used by your application should be included in this list.You may include multiple `--directory DIR` options.
So for LdapAuthentication I had to run phan with:
phan -p -d . -l .
That gets me results for the php files at the root of the repository.