vscode中对于PHP扩展类提示Undefined问题

在使用vscode时发现,在PHP项目中使用redis扩展时,使用$redis = new \Redis();会触发vscode的提示undefined type redis

在使用RdKafka扩展时及扩展中的常量RD_KAFKA_RESP_ERR_NO_ERROR时,会触发vscode的提示undefined const rd_kafka_resp_err_no_error

对于此类问题,找到PHP Intelephense插件,点击设置,在插件设置中搜索stubs,点击下面的Add Item,找到对应的扩展,添加一下就可以解决这些错误提示了。

vscode中对于PHP扩展类提示Undefined问题

原文链接:https://beltxman.com/4174.html,若无特殊说明本站内容为 行星带 原创,未经同意禁止转载。

发表评论

您的电子邮箱地址不会被公开。

Scroll to top