A method only calls the parent method of the same name

tx0/php:override-only-calls-parentrecommendedwarningmaintainability/designdepth fastsmell

What it finds

A method only calls the parent method of the same name

Example from the rule's tests
<?phpclass Child extends Base{    public function save($id, $force)tx0 reports: save only calls the parent method    {        return parent::save($id, $force);    }     public function load($id)    {        return parent::load($id, true);    }     /**     * @return Child     */    public function find($id)    {        return parent::find($id);    }     public function boot()    {        parent::boot();        $this->ready = true;    }     public function __construct(private readonly Album $album)    {        parent::__construct($album);    }     public function message($text = 'Koel Plus is required')    {        return parent::message($text);    }     public function request(string $message, RequestInterface $request, int $code = 0, ?\Throwable $previous = null)tx0 reports: request only calls the parent method    {        return parent::request($message, $request, $code, $previous);    }}
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/php:override-only-calls-parent" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/php:override-only-calls-parent] reason="..."

tx0 explain tx0/php:override-only-calls-parent shows the same in the terminal. Found a false positive? Report it.