I have two class :
class EntityVoter
{
protected function canPutToBlockChain($entity, $viewer)
{
return false;
}
}
class VerificationVoter extends EntityVoter
{
public function canPutToBlockChain($entity, $viewer)
{
return $this->canShare($entity, $viewer);
}
}
PHPMD scan EntityVoter class and throw: Avoid unused parameters such as '$entity', '$viewer'.
My solution is creating a interface:
interface EntityVoterInterface
{
function canPutToBlockChain($entity, $viewer);
}
and then add @inhericDoc
annotation:
class EntityVoter implements EntityVoterInterface
{
/**
* @inheritDoc
*/
protected function canPutToBlockChain($entity, $viewer)
{
return false;
}
}
Is there any better solution ?