PHPackages                             guuzen/psalm-enum-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. guuzen/psalm-enum-plugin

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

guuzen/psalm-enum-plugin
========================

Reports attempts to create enum with a wrong case

1.1.0(10mo ago)04.3k↓47.9%1MITPHPPHP &gt;=8.1

Since Jun 22Pushed 10mo agoCompare

[ Source](https://github.com/Guuzen/psalm-enum-plugin)[ Packagist](https://packagist.org/packages/guuzen/psalm-enum-plugin)[ RSS](/packages/guuzen-psalm-enum-plugin/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (4)Used By (1)

The problem
===========

[](#the-problem)

Psalm doesn't detect situations when we try to create backed enums using `from` method with a wrong literal

For example:

```
enum StringEnum: string
{
    case ONE = 'one';

    /**
     * @param 'two' $value
     */
    public static function createSelf(string $value): void
    {
        /**
         * Psalm won't complain
         */
        self::from($value);
    }
}
```

Might be useful if you generate OAS enums as phpdoc union literals and want to know about type problems before running your code

Installation
============

[](#installation)

[Psalm documentation](https://psalm.dev/docs/running_psalm/plugins/using_plugins/#installing-plugins)

```
composer require --dev guuzen/psalm-enum-plugin

```

It needs to be enabled by either using psalm-plugin tool:

```
vendor/bin/psalm-plugin enable guuzen/psalm-enum-plugin

```

or by manually adding to your psalm.xml

```

```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance54

Moderate activity, may be stable

Popularity23

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~10 days

Total

3

Last Release

311d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/65a64e9dbe8e6bb79a6e92a8f383272124133c9ee1cf7858d811205b82ad6c6d?d=identicon)[Guuzen](/maintainers/Guuzen)

---

Top Contributors

[![Guuzen](https://avatars.githubusercontent.com/u/11592018?v=4)](https://github.com/Guuzen "Guuzen (7 commits)")

### Embed Badge

![Health badge](/badges/guuzen-psalm-enum-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/guuzen-psalm-enum-plugin/health.svg)](https://phpackages.com/packages/guuzen-psalm-enum-plugin)
```

###  Alternatives

[psalm/plugin-phpunit

Psalm plugin for PHPUnit

7622.9M1.1k](/packages/psalm-plugin-phpunit)[roave/infection-static-analysis-plugin

Static analysis on top of mutation testing - prevents escaped mutants from being invalid according to static analysis

1314.2M265](/packages/roave-infection-static-analysis-plugin)[psalm/plugin-mockery

Psalm plugin for Mockery

102.6M53](/packages/psalm-plugin-mockery)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
