PHPackages                             misterspelik/phpstan-yii2 - 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. misterspelik/phpstan-yii2

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

misterspelik/phpstan-yii2
=========================

Yii2 extension for PHPStan

1.0.0(1y ago)02.6k↓50%MITPHPPHP ^7.2|^8.0

Since Jan 9Pushed 1y agoCompare

[ Source](https://github.com/misterspelik/phpstan-yii2)[ Packagist](https://packagist.org/packages/misterspelik/phpstan-yii2)[ RSS](/packages/misterspelik-phpstan-yii2/feed)WikiDiscussions master Synced 1mo ago

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

Yii2 extension for PHPStan
==========================

[](#yii2-extension-for-phpstan)

[![Minimum PHP Version](https://camo.githubusercontent.com/4c62148864d567c4ee794ffab09c1dd4a3f45e41064bbb016440beddaae71a4d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e322d3838393242462e737667)](https://php.net/)[![Latest Stable Version](https://camo.githubusercontent.com/1acb6ef068faaf0a1eb33d7ec62c860f43c49ba396345ef2a8b81379909058d0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d69737465727370656c696b2f7068707374616e2d796969322e737667)](https://packagist.org/packages/misterspelik/phpstan-yii2)[![Build Status](https://github.com/misterspelik/phpstan-yii2/workflows/build/badge.svg)](https://github.com/misterspelik/phpstan-yii2/actions?query=workflow%3Abuild)[![Total Downloads](https://camo.githubusercontent.com/a4b71b0205d2f8445c6ff27c9ebc458ee804f5a1691104125b3c1b70e9ae2d26/68747470733a2f2f706f7365722e707567782e6f72672f6d69737465727370656c696b2f7068707374616e2d796969322f646f776e6c6f6164732e737667)](https://packagist.org/packages/misterspelik/phpstan-yii2)[![License](https://camo.githubusercontent.com/7b45b993bca306e98742e01a1e5750792f6b1b982008b61df1a5f2033d107028/68747470733a2f2f706f7365722e707567782e6f72672f6d69737465727370656c696b2f7068707374616e2d796969322f6c6963656e73652e737667)](https://packagist.org/packages/misterspelik/phpstan-yii2)

What does it do?
----------------

[](#what-does-it-do)

- Provides correct return type for `Yii::$container->get('service_id')` method,
- Provides correct methods and properties for `Yii::$app->request`
- Ignore common problems with response objects (to be removed).

Compatibility
-------------

[](#compatibility)

PHPStan versionYii2 extension version2.x1.x1.x0.8.x0.120.7.x0.110.5.x - 0.6.x0.10.30.4.x0.100.3.00.9.20.2.0Installation
------------

[](#installation)

```
composer require --dev misterspelik/phpstan-yii2
```

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

[](#configuration)

Put this into your `phpstan.neon` config:

```
includes:
	- vendor/misterspelik/phpstan-yii2/extension.neon
parameters:
    yii2:
        config_path: %rootDir%/../../../config/test.php
```

Limitations
-----------

[](#limitations)

Container closures must have return types.

You have to provide a path to `config/test.php` or other yii2 config file.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance41

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

486d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1f6e5ed1da722746fea0d5cfa7d98174419bfc9ed934dcdcb4e3b59d6f90c840?d=identicon)[misterspelik](/maintainers/misterspelik)

---

Top Contributors

[![marmichalski](https://avatars.githubusercontent.com/u/57528542?v=4)](https://github.com/marmichalski "marmichalski (23 commits)")[![akondas](https://avatars.githubusercontent.com/u/8239917?v=4)](https://github.com/akondas "akondas (20 commits)")[![EtienneBruines](https://avatars.githubusercontent.com/u/3962174?v=4)](https://github.com/EtienneBruines "EtienneBruines (4 commits)")[![danieljonderko](https://avatars.githubusercontent.com/u/3042592?v=4)](https://github.com/danieljonderko "danieljonderko (3 commits)")[![Khartir](https://avatars.githubusercontent.com/u/5592420?v=4)](https://github.com/Khartir "Khartir (2 commits)")[![dawidrylko](https://avatars.githubusercontent.com/u/11761319?v=4)](https://github.com/dawidrylko "dawidrylko (1 commits)")[![misterspelik](https://avatars.githubusercontent.com/u/3395617?v=4)](https://github.com/misterspelik "misterspelik (1 commits)")[![particleflux](https://avatars.githubusercontent.com/u/3686454?v=4)](https://github.com/particleflux "particleflux (1 commits)")[![przepompownia](https://avatars.githubusercontent.com/u/11404453?v=4)](https://github.com/przepompownia "przepompownia (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/misterspelik-phpstan-yii2/health.svg)

```
[![Health](https://phpackages.com/badges/misterspelik-phpstan-yii2/health.svg)](https://phpackages.com/packages/misterspelik-phpstan-yii2)
```

###  Alternatives

[roave/backward-compatibility-check

Tool to compare two revisions of a public API to check for BC breaks

5953.3M56](/packages/roave-backward-compatibility-check)[coenjacobs/mozart

Composes all dependencies as a package inside a WordPress plugin

4723.6M20](/packages/coenjacobs-mozart)[recca0120/laravel-erd

Laravel ERD automatically generates Entity-Relationship Diagrams from your Laravel models and displays them using Vuerd.

36072.0k](/packages/recca0120-laravel-erd)[ticketswap/phpstan-error-formatter

A minimalistic error formatter for PHPStan

87578.8k35](/packages/ticketswap-phpstan-error-formatter)[ondrejmirtes/better-reflection

Better Reflection - an improved code reflection API

136.2M4](/packages/ondrejmirtes-better-reflection)[drupal-code-builder/drupal-code-builder

Code generator for Drupal

27241.1k1](/packages/drupal-code-builder-drupal-code-builder)

PHPackages © 2026

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