php - Phan 给出内置 JetBrains PhpStorm 注释的问题
问题描述
我对https://blog.jetbrains.com/phpstorm/2020/10/phpstorm-2020-3-eap-4/中描述的新 PhpStorm 内置注释有疑问
这是代码:
use JetBrains\PhpStorm\NoReturn;
#[NoReturn] public function __construct() {}
当我现在运行我的 Phan 静态分析器时,我收到以下错误:
PhanUndeclaredClassAttribute 对属性中未声明类 \JetBrains\PhpStorm\NoReturn 的引用
我怎样才能解决这个问题?我是否必须作曲家从 JetBrains 安装一些库才能在我的代码库中包含这些注释?
解决方案
是的,请参阅https://github.com/JetBrains/phpstorm-attributes
这些属性在 PhpStorm 2020.3 及更高版本中可用。它们与 PhpStorm 捆绑在一起,因此您无需单独安装它们。
如果您正在使用其他静态分析工具并且不想遇到 Class not found 问题,那么您可能需要将属性包添加到 composer.json 作为开发依赖项:
composer require --dev jetbrains/phpstorm-attributes
推荐阅读
- android - 为什么当我重新启动我的应用程序时我的 recyclerview 会清空?
- javascript - 无法显示 JavaScript 弹出窗口
- excel - Cell.Value 属性不存在(虽然我直到几天前才成功使用它......)
- prism - 订阅事件但想要获取初始值
- xcode - Xcode 中的文件路径损坏。(很多 ../../../../)
- formatting - 在 Power BI 中格式化“卡片”以显示数百万到 2 dp 或数千到 1 dp
- swift - 视频本地文件 URL 与保存的相册不兼容
- r - mlr:避免交叉验证中的数据泄漏
- java - 这种单例线程的实现是否安全、无序列化问题且性能良好?
- android - 在谷歌云平台上安卓设备(安卓派)和服务器之间的MQTT通信需要一些帮助