Closed ghost closed 5 years ago
Hi, can you isolate that problem so I can debug it? Create a branch, or a repository and tell me what exactly I need to run to reproduce it. It seems peculiar to me that obviously $app->user
is "Proget\Tests\PHPStan\Yii2\Yii\MyUserActiveRecord|yii\web\User" but it should only be "Proget\Tests\PHPStan\Yii2\Yii\MyUserActiveRecord".
@ondrejmirtes
Is chaining of extensions intentional?
The line is:
\Yii::$app->user->username;
Yii declares it's properties in annotations (https://github.com/yiisoft/yii2/blob/master/framework/web/Application.php#L24):
* @property User $user
which can be overriden in config file (https://github.com/proget-hq/phpstan-yii2/pull/13/files#diff-78c0996a3bf818da34eb82c4fc2a6976R10). Our custom extension parses those overrides, but phpstan is chaining this extension with annotation property extension, resulting in an error.Is there any way to solve it or are we doing something wrong?