I'm using the sniff SlevomatCodingStandard.Classes.UnusedPrivateElements and I've noticed that it cannot identify private method calls on clones.
Example:
public function foo() : void
{
$clone = clone $this;
$clone->writeFoo();
}
private function writeFoo() : void
{
}
public function bar() : void
{
$this->writeBar();
}
private function writeBar() : void
{
}
Output:
ERROR | Class FooBar contains unused private method writeFoo().