【发布时间】:2019-05-31 12:18:07
【问题描述】:
我使用 php composer.phar update 将 Yii2 从版本 2.0.13 更新到最新的 2.0.15.1,并在文档中说:
您可以通过执行以下操作开始为 Yii 2.1 准备应用程序 以下:
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.
像这样
public function behaviors()
{
return [
'access' => [
'class' => AccessControl::class,
'rules' => [
[
//
]
]
],
'verbs' => [
'class' => VerbFilter::class,
'actions' => [
'delete' => ['POST'],
],
],
];
}
但是 PhpStorm 说“类名常量仅在 PHP 5.5 中可用 检查源代码中使用的语言特性是否对应于所选的语言级别。 (即特征只能在 PHP 5.4 中使用)。”
我的 PHP 是 7.2.11,怎么了?
【问题讨论】:
标签: php yii2 composer-php phpstorm