PHPackages                             orklah/psalm-strict-types - 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-strict-types

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

orklah/psalm-strict-types
=========================

Adds strict\_types declaration when the file is provably safe

v0.1.3(4y ago)16104.0k↓42.3%[1 issues](https://github.com/orklah/psalm-strict-types/issues)MITPHPPHP ^7.3|^8.0

Since Feb 12Pushed 4y ago2 watchersCompare

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

READMEChangelog (4)Dependencies (4)Versions (5)Used By (0)

psalm-strict-types
==================

[](#psalm-strict-types)

A [Psalm](https://github.com/vimeo/psalm) plugin to add declaration of stricts\_types by analyzing content of a file

Installation:

```
$ composer require --dev orklah/psalm-strict-types
$ vendor/bin/psalm-plugin enable orklah/psalm-strict-types
```

Usage:

To launch standard analysis, run your usual Psalm command:

```
$ vendor/bin/psalm
```

To automatically add strict\_types declarations

```
$ vendor/bin/psalm --alter --plugin=vendor/orklah/psalm-strict-types/src/Plugin.php
```

Explanation:

Warning: While this plugin has been designed with safety in mind, analyzing code is hard. This plugin may add strict\_types declaration on files that could broke your production environment. Please use carefully

This plugin uses Psalm type inference and PHP-Parser's node parsing to check every possible strict\_types violation:

- Parameters in methods/functions calls
- Return statement for methods/functions
- Properties assignation

When it encounters a potentially problematic code, it will create a Psalm issue based on the criticity of the code:

- BadTypeFromDocblockIssue
- MixedBadTypeFromDocblockIssue
- PartialBadTypeFromDocblockIssue

These issues are emitted when encountering a type (inferred from docblock) that is not expected on a file that is not yet strict. The given type can either be mixed (generally not enough documented), partial (only part of an Union is expected) or totally bad (a completely different type)

- BadTypeFromDocblockOnStrictFileIssue
- MixedBadTypeFromDocblockOnStrictFileIssue
- PartialBadTypeFromDocblockOnStrictFileIssue

These issues are emitted when encountering a type (inferred from docblock) that is not expected on a file that is already strict. The given type can either be mixed (generally not enough documented), partial (only part of an Union is expected) or totally bad (a completely different type)

- BadTypeFromSignatureIssue
- MixedBadTypeFromSignatureIssue
- PartialBadTypeFromSignatureIssue

These issues are emitted when encountering a type (inferred from signature) that is not expected on a file that is not yet strict. The given type can either be mixed (generally not enough documented), partial (only part of an Union is expected) or totally bad (a completely different type)

- BadTypeFromSignatureOnStrictFileIssue
- MixedBadTypeFromSignatureOnStrictFileIssue
- PartialBadTypeFromSignatureOnStrictFileIssue

These issues are emitted when encountering a type (inferred from signature) that is not expected on a file that is already strict. The given type can either be mixed (generally not enough documented), partial (only part of an Union is expected) or totally bad (a completely different type)

- GoodTypeFromDocblockIssue

This issue is emitted when encountering a type that is expected but inferred from docblock. This plugin will not automatically add a strict\_types declaration in this case because the docblock *may* be wrong

- StrictDeclarationToAddIssue

When not in --alter mode, this issue will be emitted when the plugin detects that a declaration can be added safely for this file

Notes:

The philosophy of this plugin does not match Psalm's. In effect, solving every issue from this plugin will probably create new issues in Psalm core. (for example RedundantCast) This is due to the decision of not trusting docblock on this tool to avoid adding strict\_types when docblock is wrong.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

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 ~66 days

Total

4

Last Release

1722d ago

PHP version history (2 changes)v0.1.0PHP ^7.3

v0.1.2PHP ^7.3|^8.0

### 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 (204 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/orklah-psalm-strict-types/health.svg)

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

###  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)[ramsey/devtools

A Composer plugin to aid PHP library and application development.

7134.7k26](/packages/ramsey-devtools)

PHPackages © 2026

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