- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在使用 PhpStorm 10.0.2 开发一个 PHP 7 项目。
每当我为函数参数声明 PHPDoc @param
时,该参数具有标量类型的类型提示(string
、int
、.. .) 我收到这个警告:
Argument type does not match
这是 PhpStorm 提示的一些示例代码:
class HostConfig
{
/**
* @var string
*/
private $hostname;
/**
* @var string
*/
private $domainname;
/**
* Creates a new instance of hte HostConfig model.
*
* @param string $hostname A host name (e.g. "dev", "int", "feature-xy")
* @param string $domainname A domain name (e.g. "example.com")
*
* @throws \InvalidArgumentException If the given $hostname is empty
* @throws \InvalidArgumentException If the given $domainname is empty
*/
public function __construct(string $hostname, string $domainname)
{
if (strlen(trim($hostname)) === 0) {
throw new \InvalidArgumentException("The host name cannot be empty");
}
if (strlen(trim($domainname)) === 0) {
throw new \InvalidArgumentException("The domain name cannot be empty");
}
$this->hostname = $hostname;
$this->domainname = $domainname;
}
}
PhpStorm 的屏幕截图显示有问题的“参数类型不匹配”- 在 PHPDoc 中提示具有两个强类型字符串参数的构造函数:
有人知道我是做错了什么还是这只是 PhpStorm 中的一个错误?
最佳答案
您的 PHPStorm 版本仅在 PHP 7 发布 7 天后发布,因此它对该语言的新功能(包括标量类型提示)的支持不是很好。您遇到了 IDE 错误。您的问题是 probably this one用 PHPStorm 10.0.3 固定
关于php - 为什么PhpStorm会报 "Argument type does not match"错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38473264/
我是 Java 新手,我遇到了这个我无法解决的问题。我继承了这个项目,并且我的 scriptlet 之一中有以下代码: DefaultLogger.logMessage("DEBUG path: "+
在做web应用的自动化测试时,定位元素是必不可少的,这个过程经常会碰到定位不到元素的情况(报selenium.common.exceptions.NoSuchElementException),一般
我之前已经这样做过,但令我惊讶的是 CListCtrl 不会以颜色显示文本。我在对话框上有 ListView 控件。我正在使用 VS2010,是否还缺少其他东西? void CGameView::On
我正在尝试计算 4 个表中每个学生的 GPA: Student(STUDENT_ID, STUDENT_LNAME, STUDENT_FNAME, MAJOR) Course(COURSE_NO, C
当我在 windows 和 mac 上使用 jasper 报告时它工作正常,当我将我的应用程序部署到 linux 机器 并尝试生成它抛出的报告时 net.sf.jasperreports.engine
我正在构建 iOS 应用并尝试实现应用内购买(非消费品)。 所有 bundle ID 等都已设置并正常工作,当我获取 Apple Store 服务器时,我可以看到我的产品有效。但是,在测试时,我在 p
我正在尝试使用非固定字符数组读取用户输入,但当我在键盘上输入内容时它只是软崩溃(没有崩溃窗口)。当我在在线 C 编译器上运行它时,它说 Segmentation fault (core dumped)
事实: 无根 podman 非常适合 uid 1480 无根 podman 为 uid 2088 失败 中央操作系统 7 内核 3.10.0-1062.1.2.el7.x86_64 podman 版本
根据 homebrew-brew 官方的解释得知,MongoDB 不再是开源的了,并且已经从 Homebrew中移除 #43770 正是由于 MongoDB 的商业化不太理想,所以它选择了闭源。所
我用命令禁用collectstatic heroku config:set DISABLE_COLLECTSTATIC=1 成功将我的项目推送到 Heroku 后,手动 collectstatic 如
代码如下: public class TryStuffOutHere { public static void main(String[] args) {
我已经设置了我的 redis 服务器,以便 CONFIG GET dir --> "/var/lib/redis" 和 CONFIG GET dbfilename --> "redis.rdb". 但
我是一名优秀的程序员,十分优秀!