Skip to content

More PHPStan level 6 cleanups, last of the *.php files - #1615

Merged
cpeel merged 5 commits into
DistributedProofreaders:masterfrom
bpfoley:level6-3
Sep 1, 2026
Merged

More PHPStan level 6 cleanups, last of the *.php files#1615
cpeel merged 5 commits into
DistributedProofreaders:masterfrom
bpfoley:level6-3

Conversation

@bpfoley

@bpfoley bpfoley commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Some of this, in particular the tools/project_manager/*.php code is a bit of a maze of arrays being passed around, and sometimes large lists of return values.

I've done the minimum to add types and array shapes, but definitely more could be done.

This allows us to remove the rest of the missingType.* warning suppressions in phpstan.neon.

@cpeel cpeel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right?

Comment thread tools/proofers/my_suggestions.php Outdated
require_login();

$verbose = get_integer_param($_GET, "verbose", 0, 0, 1);
$verbose = (bool) get_integer_param($_GET, "verbose", 0, 0, 1);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$verbose = (bool) get_integer_param($_GET, "verbose", 0, 0, 1);
$verbose = get_bool_param($_GET, "verbose", false);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Err... after some double checking, yes. There was some other place in the code where I didn't want to touch a 0/1 param because the value was being string interpolated into some form HTML and I didn't want to change the output. But casting it to bool like I did here would have that side effect anyway, and as it happens $verbose is never interpolated directly in this file. So... yes :)

@cpeel
cpeel merged commit efc308f into DistributedProofreaders:master Sep 1, 2026
12 checks passed
@bpfoley
bpfoley deleted the level6-3 branch September 1, 2026 18:02
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