Skip to content

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

Notifications You must be signed in to change notification settings

psalm/psalm-attributes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

psalm-attributes

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

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages