The author intended to expose only run(), but callers can still invoke delete(). Find the mistake.
php
<?php
trait DeletesRecord
{
public function delete(): string
{
return 'deleted';
}
}
final class AdminTool
{
use DeletesRecord {
DeletesRecord::delete as private remove;
}
public function run(): string
{
return $this->remove();
}
}
echo (new AdminTool())->delete();