Psalm

用于在 PHP 应用程序中查找错误的静态分析工具。「A static analysis tool for finding errors in PHP applications」

Github星跟踪图

Psalm(诗篇)

Psalm 是一个静态分析工具,用于在 PHP 分析器 的基础上查找 PHP 应用程序中的错误。

它能够发现大量问题,但也可以配置为仅关注其中的一小部分。

尝试进行现场演示,或按照下面的《快速入门指南》将其安装在项目中。

Psalm 文档

文档可以从 docs 文件夹生成,也可在 Psalm 的网站 上找到。

要开始使用,请查看安装指南

有兴趣贡献吗?

看看 CONTRIBUTING.md

致谢

工程团队 @vimeo 给予鼓励和耐心,尤其是 @nbeliard, @erunion@nickyr

(The first version translated by vz on 2020.07.26)

主要指标

概览
名称与所有者vimeo/psalm
主编程语言PHP
编程语言PHP (语言数: 4)
平台BSD, Linux, Mac, Solaris, Windows
许可证MIT License
所有者活动
创建于2016-11-21 17:04:41
推送于2025-05-20 11:39:04
最后一次提交2025-05-06 10:26:41
发布数461
最新版本名称6.11.0 (发布于 )
第一版名称0.1 (发布于 )
用户参与
星数5.7k
关注者数58
派生数680
提交数15.5k
已启用问题?
问题数7756
打开的问题数1781
拉请求数3086
打开的拉请求数69
关闭的拉请求数348
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?

Packagist
Packagist
Travis CI
Coverage Status
Psalm coverage

Psalm is a static analysis tool for finding errors in PHP applications, built on top of PHP Parser.

It's able to find a large number of issues, but it can also be configured to only care about a small subset of those.

Try a live demo, or install it in your project by following the Quickstart Guide below.

Psalm documentation

Documentation is available on Psalm’s website, generated from the docs folder.

Quickstart Guide

Install via Composer:

composer require --dev vimeo/psalm

Add a config:

./vendor/bin/psalm --init

Then run Psalm:

./vendor/bin/psalm

The config created above will show you all issues in your code, but will emit INFO issues (as opposed to ERROR) for certain common trivial code problems. If you want a more lenient config, you can specify the level with

./vendor/bin/psalm --init [source_dir] [level]

You can also learn how to suppress certain issues.

How Psalm Works

A basic rundown of Psalm’s internals can be found in docs/how_psalm_works.md.

Acknowledgements

The engineering team @vimeo for encouragement and patience, especially @nbeliard, @erunion and @nickyr.