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

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

miserenkov/phpstan-yii2-laravel
===============================

Yii2 extension for PHPStan with Laravel proxy

v1.1.1(1y ago)07MITPHPPHP ^7.4|^8.0

Since Apr 11Pushed 1y agoCompare

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

READMEChangelog (1)Dependencies (7)Versions (4)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/58336d0e76c5262e7349dffe3d83937ff5fa9d0f15642372caf90642e7da6028/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d69736572656e6b6f762f7068707374616e2d796969322d6c61726176656c2e737667)](https://packagist.org/packages/miserenkov/phpstan-yii2-laravel)[![Build Status](https://github.com/miserenkov/phpstan-yii2-laravel/workflows/build/badge.svg)](https://github.com/miserenkov/phpstan-yii2-laravel/actions?query=workflow%3Abuild)[![Total Downloads](https://camo.githubusercontent.com/0ce66bed81e4d98cf49b7c784aa733b5a40a6d360b1b0aba779707a15c0ab220/68747470733a2f2f706f7365722e707567782e6f72672f6d69736572656e6b6f762f7068707374616e2d796969322d6c61726176656c2f646f776e6c6f6164732e737667)](https://packagist.org/packages/miserenkov/phpstan-yii2-laravel)[![License](https://camo.githubusercontent.com/a9c50b1b45a8b13595b2ee9c63a81df475d22a29db63324456593bb7a9be4ac8/68747470733a2f2f706f7365722e707567782e6f72672f6d69736572656e6b6f762f7068707374616e2d796969322d6c61726176656c2f6c6963656e73652e737667)](https://packagist.org/packages/miserenkov/phpstan-yii2-laravel)

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 miserenkov/phpstan-yii2-laravel
```

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

[](#configuration)

Put this into your `phpstan.neon` config:

```
includes:
	- vendor/miserenkov/phpstan-yii2-laravel/extension.neon
parameters:
    yii2:
        application_id: api
```

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

[](#limitations)

Container closures must have return types.

You have to provide config for yii application in laravel application in key yii.{application\_id}

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance50

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity52

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

Every ~379 days

Total

3

Last Release

368d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2da4989419ba449f8a65c166d33be4472ab6a37d3e55092f17e8ac9eba5b3574?d=identicon)[miserenkov](/maintainers/miserenkov)

---

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

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  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)[ticketswap/phpstan-error-formatter

A minimalistic error formatter for PHPStan

87578.8k35](/packages/ticketswap-phpstan-error-formatter)[worksome/coding-style

Worksomes coding style

49771.7k57](/packages/worksome-coding-style)[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)
