Skip to content

Mark debugging flags as variables so we can remove @phpstan-ignores - #1712

Merged
cpeel merged 1 commit into
DistributedProofreaders:masterfrom
bpfoley:mark-vars-as-variable
Nov 13, 2026
Merged

cpeel merged 1 commit into
DistributedProofreaders:masterfrom
bpfoley:mark-vars-as-variable

Conversation

@bpfoley

@bpfoley bpfoley commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

Otherwise PHPStan (correctly) sees these as constants, and says the conditions are always true/false.

This can also be used for scenarios where PHPStan can't see that a counter that's initialised to zero is updated elsewhere in the code (usually beacuse of a global $foo in another function).

Otherwise PHPStan (correctly) sees these as constants, and says the
conditions are always true/false.

This can also be used for scenarios where PHPStan can't see that a
counter that's initialised to zero is updated elsewhere in the code
(usually beacuse of a `global $foo` in another function).
@cpeel
cpeel merged commit 223c04e into DistributedProofreaders:master Nov 13, 2026
12 checks passed
@bpfoley
bpfoley deleted the mark-vars-as-variable branch November 13, 2026 22:05
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