【发布时间】:2012-04-07 01:29:01
【问题描述】:
我不明白为什么 PhpStorm 会针对这种方法给我以下警告 PHPDoc comment does not match function or method signature:
/**
* 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”(尝试),但它没有改变。这里有什么问题?
【问题讨论】:
标签: php warnings phpdoc phpstorm