I just upgraded from 2.0.38 to 2.0.40. I work with PHPStorm and noticed the following:
Since the Yii2 upgrade, all lines
\Yii::$app->session['key'] = value; are underlined red. PHPStorm says “@property-read” as the reason.
I took a look to the class and it is right:
* @property-read Session $session The session component. This property is read-only.
But the docs state, that:
// set a session variable. The following usages are equivalent: $session->set('language', 'en-US'); $session['language'] = 'en-US'; $_SESSION['language'] = 'en-US';
So, it should be ok. I see, that the PHPstorm error is talking about the property
session inside the class
So, is this caused by https://github.com/yiisoft/yii2/commit/ccb14ff6671279f184906024144544ce3b732393#diff-eeee8573b0fd163722a7a780827dc44ceb48b9d96b639deaa23d38dc17cc9b60 ? I think, the change is not correct, since it is not just read only. Its confusing now.