Phan: Difference between revisions
No edit summary |
|||
| Line 1: | Line 1: | ||
Phan is a '''[[wp:Static program analysis|static analyzer]]''' for PHP. It will help you write better PHP code. Please note that your source code | Phan is a '''[[wp:Static program analysis|static analyzer]]''' for PHP. It apparently originated from Etsy. It will help you write better PHP code. Please note that your source code should follow best practices for directory layout<ref>Essentially, code should live in a 'src' or 'includes' directory; tests go in 'tests' etc. | ||
https://www.mediawiki.org/wiki/Best_practices_for_extensions#File_structure</ref>. To use it, you'll need to install the [https://github.com/nikic/php-ast Abstract Syntax Tree] PHP extension. See the [https://github.com/phan/phan/wiki/Tutorial-for-Analyzing-a-Large-Sloppy-Code-Base tutorial for analyzing a large sloppy codebase] | |||
[https://github.com/phan/phan Phan project on GitHub] | [https://github.com/phan/phan Phan project on GitHub] | ||
The [[MediaWiki]] project uses Phan in its [[Continuous Integration]]. | The [[MediaWiki]] project uses Phan in its [[Continuous Integration]]. | ||
| Line 61: | Line 62: | ||
After reading that and [https://github.com/wikimedia/mediawiki/blob/d0dae26538d7c5e178de2406e88738933da05f58/.phan/config.php the source of <code>./phan/config.php</code>], we figured out the full configuration, '''and''' that you can create your own overrides/customizations in a file called <code>./phan/local-config.php</code><br /> | After reading that and [https://github.com/wikimedia/mediawiki/blob/d0dae26538d7c5e178de2406e88738933da05f58/.phan/config.php the source of <code>./phan/config.php</code>], we figured out the full configuration, '''and''' that you can create your own overrides/customizations in a file called <code>./phan/local-config.php</code><br /> | ||
===== Fully parsed configuration ===== | =====Fully parsed configuration===== | ||
{{Collapsible | {{Collapsible | ||
|visible_text=Show the full configuration for MediaWiki phan | |visible_text=Show the full configuration for MediaWiki phan | ||
| Line 280: | Line 281: | ||
https://github.com/phan/phan/tree/v5/tests/files/src | https://github.com/phan/phan/tree/v5/tests/files/src | ||
<br /> | |||
<br />{{References}}<br /> | |||
[[Category:Tools]] | [[Category:Tools]] | ||