Phpsa
Smart/Static Analyzer(sis) for PHP :bowtie::neckbeard:
Install / Use
/learn @ovr/PhpsaREADME

PHPSA - Smart Analyzer for PHP
PHPSA is a development tool aimed at bringing complex analysis for PHP applications and libraries.
P.S This software is currently in early alpha state, any contributions/stars will be awesome.
Components
- [X] Core - Component containing definitions and other core files
- [X] Compiler - Component to compile expression(s) and statement(s) from an abstract syntax tree
- [X] Analyzer - Component doing various checks on your files
- [X] ControlFlow - Component for ControlFlow (WIP)
Installation <sub>(more)</sub>
The recommended way to install phpsa is via Composer.
Run php composer.phar require ovr/phpsa or add a new requirement in your composer.json.
{
"require": {
"ovr/phpsa": "*"
}
}
How to use <sub>(more)</sub>
$ ./bin/phpsa check fixtures/
Syntax error: Syntax error, unexpected T_RETURN on line 11 in fixtures/simple/syntax/Error2.php
$b = $a + 1; 123123
Notice: Constant BBBB does not exist in self scope in fixtures/simple/undefined/Const.php on 29 [undefined-const]
return self::BBBB;
Notice: You are trying to cast 'string' to 'string' in fixtures/simple/code-smell/StandardFunctionCall.php on 16 [stupid.cast]
return (string) json_encode(array(
Notice: Missing docblock for callStaticMethodBySelf() method in fixtures/Compiling/Expression/StaticCall.php on 18 [missing-docblock]
public static function callStaticMethodBySelf()
Requirements
PHP >= 7.0, but you can check files that use PHP >= 5.2 with this.
Documentation
See our documentation in case you need more information on some topic.
Contributing
Check our Contributing Guide to see how you can help.
Sponsors
Thanks to our sponsors and supporters:
| JetBrains | |---| | <a href="https://www.jetbrains.com/phpstorm/" title="PHP IDE :: JetBrains PhpStorm" target="_blank"><img src="https://resources.jetbrains.com/assets/media/open-graph/jetbrains_250x250.png" height="55"></img></a> |
LICENSE
This project is open-sourced software licensed under the MIT License.
See the LICENSE file for more information.
Related Skills
node-connect
349.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。


