【发布时间】:2014-03-12 10:09:21
【问题描述】:
我有接口 X
interface X
{
public function foo($x, $y = 0);
}
那我上课了
class xx implements X
{
public function foo($x, $y = 0)
{
// use $x, but not $y
}
}
这是完全正常的,因为我不想在X 的这个实现中使用可选的$y。但是 PMD 大喊 $y 是未使用的参数。
我可以做些什么来轻松改变 PMD 行为?我找到的唯一解决方案是使用 @SuppressWarnings(unused) 注释来抑制警告,我敢打赌这不是我真正喜欢的。
【问题讨论】:
标签: php annotations optional-parameters code-standards phpmd