Search code examples
phpyii2composer-phpphpstorm

Yii2 - update from 2.0.13


I updated Yii2 from version 2.0.13 to the last 2.0.15.1 with php composer.phar update and in the documentation says:

You can start preparing your application for Yii 2.1 by doing the following:

Replace ::className() calls with ::class (if you’re running PHP 5.5+).
Replace usages of yii\base\InvalidParamException with yii\base\InvalidArgumentException.
Replace calls to Yii::trace() with Yii::debug().
Remove calls to yii\BaseYii::powered().
If you are using XCache or Zend data cache, those are going away in 2.1 so you might want to start looking for an alternative.

like this

public function behaviors()
    {
        return [
            'access' => [
                'class' => AccessControl::class,
                'rules' => [
                    [
                        //
                    ]
                ]
            ],
            'verbs' => [
                'class' => VerbFilter::class,
                'actions' => [
                    'delete' => ['POST'],
                ],
            ],
        ];
    }

But PhpStorm says "Class name constant is available in PHP 5.5 only Checks that language features used in the source code correspond the selected language level. (i.e. traits can be used only in PHP 5.4)."

My Php is 7.2.11, what's wrong?


Solution

  • You need to change PHP version in Settings -> Languages & Frameworks -> PHP:

    enter image description here