IDE auto-complete for Yii 1.1 custom Components

I use Yii 1.1x with Netbeans 8.0 and it auto-completes really well. Except when it doesn’t.

I added a custom component db2 (a DB connection) to /config/main.php. However, Netbeans won’t autocomplete this unless I add this PHPDoc to Yii’s framework/base/CApplication.php:

/** @property CDbConnection $db2 The database connection to Data APID server


But I’d rather not touch the framework directly as it would prevent smooth upgrades, etc. There’s a documented way to achieve this with Yii 2, here:

How can I add these PHPdoc properties to a different file and make Netbeans recognize them?