PHPackages                             slam/phpstan-laminas-framework - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. slam/phpstan-laminas-framework

ActivePhpstan-extension[Validation &amp; Sanitization](/categories/validation)

slam/phpstan-laminas-framework
==============================

Laminas Framework 3 MVC controller plugin extension for PHPStan.

v2.1.1(5mo ago)19302.0k↑39.5%12[10 issues](https://github.com/Slamdunk/phpstan-laminas-framework/issues)[5 PRs](https://github.com/Slamdunk/phpstan-laminas-framework/pulls)7MITPHPPHP ~8.4.0 || ~8.5.0CI passing

Since Jan 2Pushed 3w ago2 watchersCompare

[ Source](https://github.com/Slamdunk/phpstan-laminas-framework)[ Packagist](https://packagist.org/packages/slam/phpstan-laminas-framework)[ Fund](https://paypal.me/filippotessarotto)[ GitHub Sponsors](https://github.com/Slamdunk)[ RSS](/packages/slam-phpstan-laminas-framework/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)Dependencies (13)Versions (27)Used By (7)

PHPStan extension for Laminas Framework
=======================================

[](#phpstan-extension-for-laminas-framework)

[![Latest Stable Version](https://camo.githubusercontent.com/2b96f5b41b018448445ff1a31bbbc2c48dc6ecd236f3f2353f916a5e5d64a62f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736c616d2f7068707374616e2d6c616d696e61732d6672616d65776f726b2e737667)](https://packagist.org/packages/slam/phpstan-laminas-framework)[![Downloads](https://camo.githubusercontent.com/09fee2b65c43aea9bb90d81f663f9d6e7da62ba0d96a5b5a5e5d323523db2cff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736c616d2f7068707374616e2d6c616d696e61732d6672616d65776f726b2e737667)](https://packagist.org/packages/slam/phpstan-laminas-framework)[![Integrate](https://github.com/Slamdunk/phpstan-laminas-framework/workflows/ci/badge.svg?branch=master)](https://github.com/Slamdunk/phpstan-laminas-framework/actions)[![Code Coverage](https://camo.githubusercontent.com/4f1d5d51f8c2bb549c3916a3b058c5a140ba5f51d6b51a04469df877c059dcc3/68747470733a2f2f636f6465636f762e696f2f67682f536c616d64756e6b2f7068707374616e2d6c616d696e61732d6672616d65776f726b2f636f7665726167652e7376673f6272616e63683d6d6173746572)](https://codecov.io/gh/Slamdunk/phpstan-laminas-framework?branch=master)

- [PHPStan](https://phpstan.org/)
- [Laminas Framework](https://getlaminas.org/)

This extension provides following features:

1. Provide correct return type for `$container->get()` calls on containers of type `\Laminas\ServiceManager\ServiceLocatorInterface`, `\Interop\Container\ContainerInterface` or `\Psr\Container\ContainerInterface`
2. Handle controller plugins that are called using magic `__call()` in subclasses of `\Laminas\Mvc\Controller\AbstractController`
3. Provide correct return type for `plugin` method of `AbstractController`, `FilterChain`, `PhpRenderer` and `ValidatorChain`
4. `getApplication()`, `getRenderer()`, `getRequest()` and `getResponse()` methods on Controllers, MvcEvents, View, ViewEvent and Application returns the real instance instead of type-hinted interfaces
5. `getView()` method on `\Laminas\View\Helper\AbstractHelper` returns the real Renderer instance instead of type-hinted interface
6. `\Laminas\Stdlib\ArrayObject` is configured as a [Universal object crate](https://phpstan.org/config-reference#universal-object-crates)
7. Handle `\Laminas\Stdlib\AbstractOptions` magic properties

Installation
------------

[](#installation)

To use this extension, require it in [Composer](https://getcomposer.org/):

```
composer require --dev slam/phpstan-laminas-framework

```

If you also install [phpstan/extension-installer](https://github.com/phpstan/extension-installer) then you're all set!

 Manual installationIf you don't want to use `phpstan/extension-installer`, include extension.neon in your project's PHPStan config:

```
includes:
    - vendor/slam/phpstan-laminas-framework/extension.neon

```

Configuration
-------------

[](#configuration)

This library already recognize built-in services and plugins.

You can opt in for more advanced analysis by providing the service manager from your own application:

```
parameters:
    laminasframework:
       serviceManagerLoader: tests/service-manager.php
```

For example, `tests/service-manager.php` would look something like this:

```
$app = \Laminas\Mvc\Application::init($config);
return $app->getServiceManager();
```

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance73

Regular maintenance activity

Popularity47

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity85

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 71.4% 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 ~123 days

Recently: every ~131 days

Total

19

Last Release

178d ago

Major Versions

v0.12.7 → v1.0.02021-11-09

v1.7.0 → v2.0.02024-11-27

PHP version history (8 changes)v0.12.0PHP ^7.3

v0.12.3PHP ^7.4 || ^8.0

v1.0.0PHP &gt;=8.0

v1.2.0PHP ~8.0.0 || ~8.1.0

v1.4.0PHP ~8.1.0 || ~8.2.0

v1.5.0PHP ~8.2.0 || ~8.3.0

v2.0.0PHP ~8.2.0 || ~8.3.0 || ~8.4.0

v2.1.0PHP ~8.4.0 || ~8.5.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/50348?v=4)[Sahn Lam](/maintainers/Slam)[@slam](https://github.com/slam)

---

Top Contributors

[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (175 commits)")[![Slamdunk](https://avatars.githubusercontent.com/u/152236?v=4)](https://github.com/Slamdunk "Slamdunk (54 commits)")[![MichaelGooden](https://avatars.githubusercontent.com/u/1275012?v=4)](https://github.com/MichaelGooden "MichaelGooden (9 commits)")[![bitwombat](https://avatars.githubusercontent.com/u/3937658?v=4)](https://github.com/bitwombat "bitwombat (3 commits)")[![InvisibleSmiley](https://avatars.githubusercontent.com/u/21109801?v=4)](https://github.com/InvisibleSmiley "InvisibleSmiley (2 commits)")[![neilime](https://avatars.githubusercontent.com/u/314088?v=4)](https://github.com/neilime "neilime (1 commits)")[![ondrejmirtes](https://avatars.githubusercontent.com/u/104888?v=4)](https://github.com/ondrejmirtes "ondrejmirtes (1 commits)")

---

Tags

laminasphpphpstanstatic-analysis

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/slam-phpstan-laminas-framework/health.svg)

```
[![Health](https://phpackages.com/badges/slam-phpstan-laminas-framework/health.svg)](https://phpackages.com/packages/slam-phpstan-laminas-framework)
```

###  Alternatives

[rector/rector

Instant Upgrade and Automated Refactoring of any PHP code

10.4k139.2M10.1k](/packages/rector-rector)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.5k55.4M9.2k](/packages/larastan-larastan)[phpstan/phpstan-symfony

Symfony Framework extensions and rules for PHPStan

79475.7M2.3k](/packages/phpstan-phpstan-symfony)[phpstan/phpstan-doctrine

Doctrine extensions for PHPStan

67372.8M1.5k](/packages/phpstan-phpstan-doctrine)[shipmonk/dead-code-detector

Dead code detector to find unused PHP code via PHPStan extension. Can automatically remove dead PHP code. Supports libraries like Symfony, Doctrine, PHPUnit etc. Detects dead cycles. Can detect dead code that is tested.

4853.5M98](/packages/shipmonk-dead-code-detector)[tomasvotruba/cognitive-complexity

PHPStan rules to measure cognitive complexity of your classes and methods

1635.6M295](/packages/tomasvotruba-cognitive-complexity)

PHPackages © 2026

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