Spot the bug in the trait alias

from Traits
PHP 8.3.33 intermediate 4 min 1 issue to find

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();
Open in playground
Report an error