PHPackages                             orklah/psalm-type-setters-params - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. orklah/psalm-type-setters-params

ActivePsalm-plugin[Utility &amp; Helpers](/categories/utility)

orklah/psalm-type-setters-params
================================

Use property type to fix param in the setter

v1.0.0(4y ago)4594MITPHPPHP ^7.3|^8.0

Since Sep 13Pushed 4y ago2 watchersCompare

[ Source](https://github.com/orklah/psalm-type-setters-params)[ Packagist](https://packagist.org/packages/orklah/psalm-type-setters-params)[ RSS](/packages/orklah-psalm-type-setters-params/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

psalm-type-setters-param
========================

[](#psalm-type-setters-param)

A [Psalm](https://github.com/vimeo/psalm) plugin that use property type to fix param in the setter

Installation:

```
$ composer require --dev orklah/psalm-type-setters-param
$ vendor/bin/psalm-plugin enable orklah/psalm-type-setters-param
```

Usage:

To automatically fix code, run:

```
$ vendor/bin/psalm --alter --plugin=vendor\orklah\psalm-type-setters-param\src\Plugin.php
```

Explanation:

When a property has a type, we can deduce that any setter should not take a type that is wider than the property. When this plugin detect such a case, it adds the type to the param.

Warning: if the class of the setter does not have a strict\_type declaration and the file that call the setter does, this plugin may create a TypeError if there was an implicit cast. Please use orklah\\psalm-strict-types to avoid such cases. (If someone is interested, it may be possible to check that specific case and prevent the replacement, please create an issue)

This idea was first implemented by Rector for PHPStan: Please read their article and the rest of rectors in the set:

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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

Unknown

Total

1

Last Release

1700d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e260f2252ede6d70aea471f0c0e0b0cf81f48c2edc3b22ff08abe1a74316fcca?d=identicon)[orklah](/maintainers/orklah)

---

Top Contributors

[![orklah](https://avatars.githubusercontent.com/u/9605520?v=4)](https://github.com/orklah "orklah (5 commits)")[![danog](https://avatars.githubusercontent.com/u/7339644?v=4)](https://github.com/danog "danog (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/orklah-psalm-type-setters-params/health.svg)

```
[![Health](https://phpackages.com/badges/orklah-psalm-type-setters-params/health.svg)](https://phpackages.com/packages/orklah-psalm-type-setters-params)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[php-standard-library/psalm-plugin

Psalm plugin for the PHP Standard Library

252.0M47](/packages/php-standard-library-psalm-plugin)[humanmade/psalm-plugin-wordpress

WordPress stubs and plugin for Psalm static analysis.

81459.7k23](/packages/humanmade-psalm-plugin-wordpress)[codeigniter4/devkit

Development toolkit for CodeIgniter libraries and projects

68187.1k82](/packages/codeigniter4-devkit)

PHPackages © 2026

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