为什么我在PhpStorm中得到一个PHPDoc警告这个代码

我不明白为什么PHPStorm给了我以下警告 PHPDoc注释与这种方法不匹配函数方法签名:
/**
 * Create a new instance of the class
 * @param string $classname Class to instantiate
 * @return object the instance
 * @throw FactoryException If the class is not instantiable
 */
private function newInstance($classname) {
    $reflectionClass = new \ReflectionClass($classname);
    if (! $reflectionClass->isInstantiable()) {
        throw new FactoryException("The class $classname is not instantiable.");
    }
    return new $classname;
}

警告并不是非常具体,我已经尝试过几种改变返回类型为“Object”,“mixed”甚至“int”(尝试)的东西,但没有改变.这里有什么问题?

应该是@throws不@throw.

如果您只是在函数或类var声明的行上键入/ **,它将为您自动插入基础PHPDoc.这就是我注意到的区别.

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...