Skip to content

Delete the error base's unused render method - #728

Merged
blaipr merged 1 commit into
mainfrom
refactor/drop-dead-error-view
Aug 13, 2026
Merged

Delete the error base's unused render method#728
blaipr merged 1 commit into
mainfrom
refactor/drop-dead-error-view

Conversation

@blaipr

@blaipr blaipr commented Aug 13, 2026

Copy link
Copy Markdown
Member

What

ErrorBase::view() rendered the template, echoed it, and called die().

Nothing called it. It is final protected, and each of the four error controllers returns ActionResponse::ok($this->view->render()) itself — which is what the dispatch contract requires. A method that echoes and exits could not satisfy that contract anyway: it would send the page and then die before the action could return anything.

So it is a leftover from the move to ActionResponse, sitting in the one place nobody looks — the error path. Its imports go with it.

Found while covering the tail (#727), where it was reported rather than reached through an artificial subclass invented to give it a caller.

Testing

Both suites green: 3081 unit, 850 integration. PHPStan and PHPCS clean.

And because "nothing calls it" is exactly the claim that deserves a live check rather than a grep, all four pages were requested against the running application afterwards — the error index, maintenance, database error and database connection pages each still render:

error/index                  200 4360
error/maintenanceError       200 4884
error/databaseError          200 5166
error/databaseConnection     200 5156

ErrorBase::view() rendered the template, echoed it and called die(). Nothing
called it: it is final protected, and each of the four error controllers returns
ActionResponse::ok($this->view->render()) itself, which is what the dispatch
contract requires — a method that echoes and exits could not satisfy it anyway.

It was left behind by the move to that contract, in the one place nobody looks.
Its imports go with it.

All four pages were requested against the running application afterwards: the
error index, maintenance, database error and database connection pages each
still render.
@blaipr
blaipr merged commit ff6c697 into main Aug 13, 2026
8 checks passed
@blaipr
blaipr deleted the refactor/drop-dead-error-view branch August 13, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant