Skip to content

PHPStan level 7: Remove several uses of stdClass in the codebase - #1644

Merged
cpeel merged 7 commits into
DistributedProofreaders:masterfrom
bpfoley:de-objectify
Sep 21, 2026
Merged

cpeel merged 7 commits into
DistributedProofreaders:masterfrom
bpfoley:de-objectify

Conversation

@bpfoley

@bpfoley bpfoley commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

In several places we create stdClass objects just to pass around some read-only data. The way they're used is only one step up from an associative array.

Replace most of these with explicit DTOs, since it's so cheap to do this in PHP 8.0. They act as documentation to the developer, and both PHPStan and PHP can see their property types.

Comment thread pinc/TallyBoard.inc Outdated
@cpeel
cpeel merged commit 949b60a into DistributedProofreaders:master Sep 21, 2026
12 checks passed
@bpfoley
bpfoley deleted the de-objectify branch September 21, 2026 21:15
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.

2 participants