我正在使用PhpStorm 10.0.2 开发PHP 7项目。
每当我@param为具有标量类型 ( string, int, ...)类型提示的函数参数声明 PHPDoc 时,我都会收到以下警告:
参数类型不匹配
以下是 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 …Run Code Online (Sandbox Code Playgroud)