PHPackages                             slam/phpstan-zend-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. [Testing &amp; Quality](/categories/testing)
4. /
5. slam/phpstan-zend-framework

Abandoned → [slam/phpstan-laminas-framework](/?search=slam%2Fphpstan-laminas-framework)ArchivedPhpstan-extension[Testing &amp; Quality](/categories/testing)

slam/phpstan-zend-framework
===========================

Zend Framework 3 MVC controller plugin extension for PHPStan.

v0.11.0(7y ago)59.3k1MITPHPPHP ^7.1

Since Jun 7Pushed 6y agoCompare

[ Source](https://github.com/Slamdunk/phpstan-zend-framework)[ Packagist](https://packagist.org/packages/slam/phpstan-zend-framework)[ RSS](/packages/slam-phpstan-zend-framework/feed)WikiDiscussions master Synced 2w ago

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

> ## Repository abandoned 2019-12-31
>
> [](#repository-abandoned-2019-12-31)
>
> This repository has moved to [Slamdunk/phpstan-laminas-framework](https://github.com/Slamdunk/phpstan-laminas-framework).

PHPStan extension for Zend Framework
====================================

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

[![Build Status](https://camo.githubusercontent.com/facb6cd4eaf0e1743787674520017537142a1e9792186f866508b97f2bdd8a38/68747470733a2f2f7472617669732d63692e6f72672f536c616d64756e6b2f7068707374616e2d7a656e642d6672616d65776f726b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Slamdunk/phpstan-zend-framework)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/0e7e670b92ea5dc22526f9c9e8900877c31d218000847cdf384779e06ebd3603/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f536c616d64756e6b2f7068707374616e2d7a656e642d6672616d65776f726b2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Slamdunk/phpstan-zend-framework/?branch=master)[![Packagist](https://camo.githubusercontent.com/4f974f8676bc23bb1a04d0dedb7ef462278985a8f42d9d79794efe6fe6e3b40d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736c616d2f7068707374616e2d7a656e642d6672616d65776f726b2e737667)](https://packagist.org/packages/slam/phpstan-zend-framework)[![Total Downloads](https://camo.githubusercontent.com/bf9233b646c41ef2d5eaca4b510df261c5631e423c44273f68ed193f784b9f72/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736c616d2f7068707374616e2d7a656e642d6672616d65776f726b2e737667)](https://packagist.org/packages/slam/phpstan-zend-framework)

- [PHPStan](https://github.com/phpstan/phpstan)
- [Zend Framework](https://framework.zend.com/)

This extension provides following features:

1. Provide correct return types for `\Zend\ServiceManager\ServiceLocatorInterface::get()` using real service instances
2. Handle controller plugins that are called using magic `__call()` in subclasses of `\Zend\Mvc\Controller\AbstractController`
3. `getApplication()`, `getRenderer()`, `getRequest()` and `getResponse()` methods on Controllers, MvcEvents, View, ViewEvent and Application returns the real instance instead of type-hinted interfaces
4. `getView()` method on `\Zend\View\Helper\AbstractHelper` returns the real Renderer instance instead of type-hinted interface
5. `\Zend\Stdlib\ArrayObject` is configured as a [Universal object crate](https://github.com/phpstan/phpstan#universal-object-crates)
6. Handle `\Zend\Stdlib\AbstractOptions` magic properties

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

[](#installation)

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

```
composer require --dev slam/phpstan-zend-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-zend-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:
    zendframework:
       serviceManagerLoader: tests/service-manager.php
```

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

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

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

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

2580d ago

### Community

Maintainers

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

---

Top Contributors

[![Slamdunk](https://avatars.githubusercontent.com/u/152236?v=4)](https://github.com/Slamdunk "Slamdunk (20 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)")

---

Tags

phpphpstanstatic-analysiszend-framework

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[larastan/larastan

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

6.4k51.0M7.7k](/packages/larastan-larastan)[phpstan/phpstan-symfony

Symfony Framework extensions and rules for PHPStan

79473.3M2.0k](/packages/phpstan-phpstan-symfony)[phpstan/phpstan-doctrine

Doctrine extensions for PHPStan

67270.7M1.3k](/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.

4813.1M84](/packages/shipmonk-dead-code-detector)[spaze/phpstan-disallowed-calls

PHPStan rules to detect disallowed method &amp; function calls, constant, namespace, attribute, property &amp; superglobal usages, with powerful rules to re-allow a call or a usage in places where it should be allowed.

33421.8M510](/packages/spaze-phpstan-disallowed-calls)[mglaman/phpstan-drupal

Drupal extension and rules for PHPStan

20730.6M167](/packages/mglaman-phpstan-drupal)

PHPackages © 2026

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