gpt4 book ai didi

php - Phan 给出内置 JetBrains PhpStorm 注释的问题

转载 作者:行者123 更新时间:2023-12-02 16:16:05 30 4
gpt4 key购买 nike

我对 https://blog.jetbrains.com/phpstorm/2020/10/phpstorm-2020-3-eap-4/ 中描述的新 PhpStorm 内置注释有疑问

这是代码:

use JetBrains\PhpStorm\NoReturn;
#[NoReturn] public function __construct() {}

当我现在运行我的 Phan 静态分析器时,我收到以下错误:

PhanUndeclaredClassAttribute Reference to undeclared class \JetBrains\PhpStorm\NoReturn in an attribute

我该如何解决这个问题?我是否必须从 JetBrains 中安装一些 lib,以便在我的代码库中包含这些注释?

最佳答案

是的,参见 https://github.com/JetBrains/phpstorm-attributes

The attributes are available in PhpStorm 2020.3 and later. They are bundled with PhpStorm so you don’t need to install them separately.

If you are using other static analysis tools and don’t want to get Class not found issues, then you might want to add the attributes package to your composer.json as a dev dependency:

composer require --dev jetbrains/phpstorm-attributes

关于php - Phan 给出内置 JetBrains PhpStorm 注释的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66689434/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com