PHPackages                             proget-hq/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. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. proget-hq/phpstan-yii2

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

proget-hq/phpstan-yii2
======================

Yii2 extension for PHPStan

0.8.0(4y ago)51575.1k—5.7%24[8 issues](https://github.com/proget-hq/phpstan-yii2/issues)[1 PRs](https://github.com/proget-hq/phpstan-yii2/pulls)7MITPHPPHP ^7.2|^8.0CI failing

Since Mar 6Pushed 2y ago1 watchersCompare

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

READMEChangelog (10)Dependencies (6)Versions (17)Used By (7)

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/ccd2a8759b33e60662a008adbe0f5e1113200a91cd75a9b0836ba20cca5b46d8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70726f6765742d68712f7068707374616e2d796969322e737667)](https://packagist.org/packages/proget-hq/phpstan-yii2)[![Build Status](https://github.com/proget-hq/phpstan-yii2/workflows/build/badge.svg)](https://github.com/proget-hq/phpstan-yii2/actions?query=workflow%3Abuild)[![Total Downloads](https://camo.githubusercontent.com/641b0a0c68a0b9a6556204a6fe44752a1bb4976e6b4cc1d8d84371788a507a68/68747470733a2f2f706f7365722e707567782e6f72672f70726f6765742d68712f7068707374616e2d796969322f646f776e6c6f6164732e737667)](https://packagist.org/packages/proget-hq/phpstan-yii2)[![License](https://camo.githubusercontent.com/3cbe6209a43b564657f8892bbfa3dd30ebf0b68c0f80230915c6d0bb6b3cc4b6/68747470733a2f2f706f7365722e707567782e6f72672f70726f6765742d68712f7068707374616e2d796969322f6c6963656e73652e737667)](https://packagist.org/packages/proget-hq/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 version1.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 proget-hq/phpstan-yii2
```

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

[](#configuration)

Put this into your `phpstan.neon` config:

```
includes:
	- vendor/proget-hq/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

44

—

FairBetter than 92% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity51

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity66

Established project with proven stability

 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

Every ~93 days

Recently: every ~136 days

Total

16

Last Release

1589d ago

PHP version history (3 changes)0.1.0PHP ^7.1

0.6.0PHP ^7.2

0.7.4PHP ^7.2|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5d00e1e73a4ff379162b943421469055929a95e7a6ce4c3808976dcc1fa28f4f?d=identicon)[akondas](/maintainers/akondas)

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

---

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)")[![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)")

---

Tags

phpphpstanphpstan-extensionyii2

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[symfony/stopwatch

Provides a way to profile code

2.8k387.2M918](/packages/symfony-stopwatch)[ssch/typo3-rector

Instant fixes for your TYPO3 PHP code by using Rector.

2592.8M263](/packages/ssch-typo3-rector)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

134391.5k12](/packages/rector-rector-src)[pcov/clobber

402.5M58](/packages/pcov-clobber)[tomasvotruba/phpstan-bodyscan

Get error count for each PHPStan level

13478.6k1](/packages/tomasvotruba-phpstan-bodyscan)[savinmikhail/add_named_arguments_rector

Rector rule to add names to arguments for functions'/methods' calls

1969.5k3](/packages/savinmikhail-add-named-arguments-rector)

PHPackages © 2026

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