Skip to content

Re-enable PHPStan level 5 arguments.count warning, fix all warnings - #1617

Merged
cpeel merged 1 commit into
DistributedProofreaders:masterfrom
bpfoley:level5-1
Sep 1, 2026
Merged

Re-enable PHPStan level 5 arguments.count warning, fix all warnings#1617
cpeel merged 1 commit into
DistributedProofreaders:masterfrom
bpfoley:level5-1

Conversation

@bpfoley

@bpfoley bpfoley commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Most of these were spurious and an effect of PHPStan treating all our *.php files as being in the same namespace: we occasionally have functions with identical names but different signatures defined in different *.php files and PHPStan gets confused by this.

The proper fix would be to add a unique namespace Foo; to the top of each PHP file, but for now I just add a unique prefix to the conflicting function name with.

arguments.count did catch one real error:
sprintf(_('template %1$s %2$s', $arg1, $arg2)) instead of
sprintf(_('template %1$s %2$s'), $arg1, $arg2))

Most of these were spurious and an effect of PHPStan treating all our
*.php files as being in the same namespace: we occasionally have
functions with identical names but different signatures defined in
different *.php files and PHPStan gets confused by this.

The proper fix would be to add a unique `namespace Foo;` to the top
of each PHP file, but for now I just add a unique prefix to the
conflicting function name with.

arguments.count did catch one real error:
   `sprintf(_('template %1$s %2$s', $arg1, $arg2))` instead of
   `sprintf(_('template %1$s %2$s'), $arg1, $arg2))`
@cpeel
cpeel merged commit 8bea201 into DistributedProofreaders:master Sep 1, 2026
12 checks passed
@bpfoley
bpfoley deleted the level5-1 branch September 2, 2026 07: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