PHPackages                             php-static-analysis/psalm-plugin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. php-static-analysis/psalm-plugin

ActiveComposer-plugin[Testing &amp; Quality](/categories/testing)

php-static-analysis/psalm-plugin
================================

Psalm plugin to read static analysis attributes

0.5.0(11mo ago)27.5k↓34.8%4MITPHPPHP &gt;=8.1CI passing

Since Feb 9Pushed 11mo agoCompare

[ Source](https://github.com/php-static-analysis/psalm-plugin)[ Packagist](https://packagist.org/packages/php-static-analysis/psalm-plugin)[ GitHub Sponsors](https://github.com/carlos-granados)[ RSS](/packages/php-static-analysis-psalm-plugin/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (11)Versions (26)Used By (4)

PHP Static Analysis Attributes Psalm Plugin
===========================================

[](#php-static-analysis-attributes-psalm-plugin)

[![Continuous Integration](https://github.com/php-static-analysis/psalm-plugin/workflows/All%20Tests/badge.svg)](https://github.com/php-static-analysis/psalm-plugin/actions)[![Latest Stable Version](https://camo.githubusercontent.com/d358872b9f0a97ed0bb73ef11e7e55759de3917d72a652fbd094b7562600ad87/68747470733a2f2f706f7365722e707567782e6f72672f7068702d7374617469632d616e616c797369732f7073616c6d2d706c7567696e2f762f737461626c65)](https://packagist.org/packages/php-static-analysis/psalm-plugin)[![License](https://camo.githubusercontent.com/99f5381436e8967587073a97fbb7214e55e270117a499d4525427886224c448f/68747470733a2f2f706f7365722e707567782e6f72672f7068702d7374617469632d616e616c797369732f7073616c6d2d706c7567696e2f6c6963656e7365)](https://github.com/php-static-analysis/psalm-plugin/blob/main/LICENSE)[![Total Downloads](https://camo.githubusercontent.com/8930308402a82e6032f58028bf27f3ab273856d0fbebb3e24914859dba395046/68747470733a2f2f706f7365722e707567782e6f72672f7068702d7374617469632d616e616c797369732f7073616c6d2d706c7567696e2f646f776e6c6f616473)](https://packagist.org/packages/php-static-analysis/psalm-plugin/stats)

Since the release of PHP 8.0 more and more libraries, frameworks and tools have been updated to use attributes instead of annotations in PHPDocs.

However, static analysis tools like Psalm have not made this transition to attributes and they still rely on annotations in PHPDocs for a lot of their functionality.

This is a Psalm plugin that allows Psalm to understand a new set of attributes that replace the PHPDoc annotations. These attributes are defined in [this repository](https://github.com/php-static-analysis/attributes)

NOTE: Version 0.4.0 of this plugin requires Php Parser v5. The current available version of Psalm (v5) does not support this version of the parser, so currently this library only supports the `dev-master` version of Psalm. If you need to use Psalm 5, you will need to use version 0.3 of this plugin.

Example
-------

[](#example)

In order to show how code would look with these attributes, we can look at the following example. This is how a class looks like with the current annotations:

```
