PHPackages                             bazilio/yii2-stubs-generator - 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. bazilio/yii2-stubs-generator

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

bazilio/yii2-stubs-generator
============================

Yii2 component stubs generator for Yii::$app

1.6.2(5y ago)146720.4k↓14.8%25[1 PRs](https://github.com/bazilio91/yii2-stubs-generator/pulls)1MITPHP

Since May 7Pushed 5y ago14 watchersCompare

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

READMEChangelog (8)Dependencies (1)Versions (14)Used By (1)

Yii::$app stubs generator for Yii 2
===================================

[](#yiiapp-stubs-generator-for-yii-2)

[![Latest Stable Version](https://camo.githubusercontent.com/2b62c605cfe36ee30df49989c53cc2bba3c80104c675029bf70430906c5fdfda/68747470733a2f2f706f7365722e707567782e6f72672f62617a696c696f2f796969322d73747562732d67656e657261746f722f762f737461626c65)](https://packagist.org/packages/bazilio/yii2-stubs-generator)[![Total Downloads](https://camo.githubusercontent.com/984e3a15f9ae6819d756e5b45bcd555d5ba767457be380aaa9f8cdd8cb65e2e0/68747470733a2f2f706f7365722e707567782e6f72672f62617a696c696f2f796969322d73747562732d67656e657261746f722f646f776e6c6f616473)](https://packagist.org/packages/bazilio/yii2-stubs-generator)[![Latest Unstable Version](https://camo.githubusercontent.com/dd782064262df064c68742b9a83ffd855493893bc2208ae42cdc1a85beb726b5/68747470733a2f2f706f7365722e707567782e6f72672f62617a696c696f2f796969322d73747562732d67656e657261746f722f762f756e737461626c65)](https://packagist.org/packages/bazilio/yii2-stubs-generator)[![License](https://camo.githubusercontent.com/8a3efa9744acf848fff986c0dd87b990bff0a231705146fea98db9464745f85e/68747470733a2f2f706f7365722e707567782e6f72672f62617a696c696f2f796969322d73747562732d67656e657261746f722f6c6963656e7365)](https://packagist.org/packages/bazilio/yii2-stubs-generator)

This extension provides no-more-butthurt components &amp; user identity autocomplete generator command for Yii 2.

[![in action](https://camo.githubusercontent.com/1b6897a0973593fe6acdbd8c138fe2ce90dd7545af3931b55473b85c233a504e/68747470733a2f2f6d6f6e6f736e61702e636f6d2f66696c652f6f48556a425377376f494a4859414570514b73346d56564a4c664d4c724d2e706e67)](https://camo.githubusercontent.com/1b6897a0973593fe6acdbd8c138fe2ce90dd7545af3931b55473b85c233a504e/68747470733a2f2f6d6f6e6f736e61702e636f6d2f66696c652f6f48556a425377376f494a4859414570514b73346d56564a4c664d4c724d2e706e67)

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --dev --prefer-dist bazilio/yii2-stubs-generator

```

or add

```
"bazilio/yii2-stubs-generator": "~1"
```

to the `require-dev` section of your `composer.json`.

Usage
-----

[](#usage)

To use this extension, simply add the following code in your application configuration (console.php):

```
'controllerMap' => [
    'stubs' => [
        'class' => 'bazilio\stubsgenerator\StubsController',
    ],
],
```

```
# generate stubs for console application
php yii stubs console/config/main.php

# to generate stubs for several apps
php yii stubs console/config/main.php common/config/main.php frontend/config/main.php

```

File with stubs by default located in vendor directory.

Usage with PhpStorm
-------------------

[](#usage-with-phpstorm)

1. Install `File Watchers` JetBrains plugin
2. Open `File Watchers` plugin config and import [watcher.xml](watcher.xml)
3. Edit imported watcher for your needs
4. Add scope to limit trigger to config files: [![](https://camo.githubusercontent.com/64633b27b895d3d0ef922577f53ed9cf0117ba77c02b75131f91e625fd33243a/68747470733a2f2f6d6f6e6f736e61702e636f6d2f66696c652f3955644541735a55784f3658634f78494e676d31737563577875755975342e706e67)](https://camo.githubusercontent.com/64633b27b895d3d0ef922577f53ed9cf0117ba77c02b75131f91e625fd33243a/68747470733a2f2f6d6f6e6f736e61702e636f6d2f66696c652f3955644541735a55784f3658634f78494e676d31737563577875755975342e706e67)

#### PhpStorm "multiple definitions exist for class"

[](#phpstorm-multiple-definitions-exist-for-class)

To hide this message:

1. Find a duplicate class file (not created by this generator), for example: `vendor/yiisoft/yii/YiiBase.php`
2. Mark it as a plain text in file context menu.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity54

Moderate usage in the ecosystem

Community24

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 63% 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 ~169 days

Recently: every ~32 days

Total

13

Last Release

1999d ago

Major Versions

0.0.3 → 1.0.02015-12-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/296aeff8442778437ea316ca1bd2fb30f87292ba6bfb3d897f292474e2c1075f?d=identicon)[bazilio91](/maintainers/bazilio91)

---

Top Contributors

[![bazilio91](https://avatars.githubusercontent.com/u/380542?v=4)](https://github.com/bazilio91 "bazilio91 (17 commits)")[![antonovsky](https://avatars.githubusercontent.com/u/4415684?v=4)](https://github.com/antonovsky "antonovsky (3 commits)")[![vjik](https://avatars.githubusercontent.com/u/525501?v=4)](https://github.com/vjik "vjik (3 commits)")[![githubjeka](https://avatars.githubusercontent.com/u/874234?v=4)](https://github.com/githubjeka "githubjeka (2 commits)")[![phrakon](https://avatars.githubusercontent.com/u/7921014?v=4)](https://github.com/phrakon "phrakon (1 commits)")[![sheershoff](https://avatars.githubusercontent.com/u/1510318?v=4)](https://github.com/sheershoff "sheershoff (1 commits)")

---

Tags

autocompletephpphpstormyii2autocompletephpstormstubsyii2

### Embed Badge

![Health badge](/badges/bazilio-yii2-stubs-generator/health.svg)

```
[![Health](https://phpackages.com/badges/bazilio-yii2-stubs-generator/health.svg)](https://phpackages.com/packages/bazilio-yii2-stubs-generator)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[jetbrains/phpstorm-stubs

PHP runtime &amp; extensions header files for PhpStorm

1.4k27.7M68](/packages/jetbrains-phpstorm-stubs)[phalcon/ide-stubs

The most complete Phalcon Framework IDE stubs library which enables autocompletion in modern IDEs.

1623.1M121](/packages/phalcon-ide-stubs)[mis/yii2-ide-helper

Yii2 IDE Helper, generates correct PHPDocs for all components, to improve auto-completion.

1664.2k3](/packages/mis-yii2-ide-helper)

PHPackages © 2026

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