nvlad / yii2support

Yii2 Support for PhpStorm / IntelliJ IDEA
https://plugins.jetbrains.com/idea/plugin/9388-yii2-support
Other
295 stars 54 forks source link

plugin does not support '__class' configuration key #259

Closed phrakon closed 3 years ago

phrakon commented 4 years ago

What steps will reproduce the problem?

Create configuration like that:

<?= GridView::widget([
    'dataProvider' => $dataProvider,
    'columns' => [
        [
            '__class' => ActionColumn::class,
            'template' => '{update} {delete}{restore}',
            'headerOptions' => ['class' => 'min'],
            'contentOptions' => ['class' => 'min'],
        ],
    ],
]) ?>

What is the expected result?

No inspection warnings.

What do you get instead?

Field '__class' not exists in referenced class \yii\grid\DataColumn

Additional info

There is no warning when use 'class'. 'class' works similar '_class'.

https://github.com/yiisoft/yii2/pull/17607

Looks like missing an additional condition:

https://github.com/nvlad/yii2support/blob/2766730b832c3a2b383cb4d624613c2d4762629a/src/com/nvlad/yii2support/objectfactory/ObjectFactoryMissedFieldInspection.java#L40

Q A
IDE Name PhpStorm
IDE Version 2020.2
Plugin version latest
Yii App Template advanced
nvlad commented 3 years ago

Support for __class added at version 0.10.58.37. Please update plugin.