psalm/attributes

A collection of PHP 8 Attributes that Psalm can understand

Package info

github.com/psalm/psalm-attributes

pkg:composer/psalm/attributes

Statistics

Installs: 122 166

Dependents: 4

Suggesters: 0

Stars: 19

Open Issues: 0

0.1.0 2020-10-31 02:02 UTC

Requires

  • php: >=8

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT c796c2da0841a97dac3b7a1f8a5d6fe3f866b6ca

  • Matthew Brown

phpattributesstatic analysis

This package is auto-updated.

Last update: 2026-06-29 01:51:02 UTC


README

A repository for PHP 8 Attributes that you can use with Psalm.

Installation

The potential for PHP 8's runtime attribute reflection somewhere in your codebase makes this complicated.

If the following code exists your codebase:

function getClassAttributes(string $className) {
 foreach ((new ReflectionClass($className))->getAttributes() as $attr) {
 $attr->newInstance();
 }
}

And there’s a possibility it might load classes with these particular attributes then install with

composer require psalm/attributes:*

If you’re not planning to use any runtime attribute reflection (and nobody might use it on your library/package classes) then it should be safe to install with

composer require --dev psalm/attributes