Psalm

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

Github stars Tracking Chart

Psalm(诗篇)

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

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

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

Psalm 文档

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

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

有兴趣贡献吗?

看看 CONTRIBUTING.md

致谢

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

(The first version translated by vz on 2020.07.26)

Main metrics

Overview
Name With Ownervimeo/psalm
Primary LanguagePHP
Program languagePHP (Language Count: 4)
PlatformBSD, Linux, Mac, Solaris, Windows
License:MIT License
所有者活动
Created At2016-11-21 17:04:41
Pushed At2025-05-20 11:39:04
Last Commit At2025-05-06 10:26:41
Release Count461
Last Release Name6.11.0 (Posted on )
First Release Name0.1 (Posted on )
用户参与
Stargazers Count5.7k
Watchers Count58
Fork Count680
Commits Count15.5k
Has Issues Enabled
Issues Count7756
Issue Open Count1781
Pull Requests Count3086
Pull Requests Open Count69
Pull Requests Close Count348
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

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.