Skip to content

Run rules on CollectedDataNode that do not call get(), and every rule with -vvv - #6881

Merged
ondrejmirtes merged 2 commits into
phpstan:2.3.xfrom
SanderMuller:rerun-collected-data-rules-without-get
Oct 28, 2026
Merged

ondrejmirtes merged 2 commits into
phpstan:2.3.xfrom
SanderMuller:rerun-collected-data-rules-without-get

Conversation

@SanderMuller

Copy link
Copy Markdown
Contributor

Two follow-ups to #6840, from #6840 (comment).

A rule on CollectedDataNode that never calls get() now runs every time. Such a rule works with something other than the collected data. For example, pb30/phpstan-composer-analysis runs composer-dependency-analyser over the project and only asks isOnlyFilesAnalysis(). Before, its errors were reused on every warm run. This also holds for a rule that tracks values with DependencyTracker but does not call get().

With -vvv, every rule runs too. That is when the diagnose extensions print, and a rule can fill what they print only while it runs. dead-code-detector 1.4.2 shows this: DeadCodeRule is also a DiagnoseExtension. When its errors were reused, -vvv printed "Usage debugging is unavailable in files-only analysis." and left out the usages over unknown types. The rule results are still saved, so the next run without -vvv can reuse them.

🤖 Generated with Claude Code

SanderMuller and others added 2 commits October 29, 2026 00:30
Such a rule works with something other than the collected data, for
example a tool that it runs over the whole project. Its errors were
reused on every warm run.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
With -vvv the diagnose extensions print, and a rule can fill what they
print only while it runs. The rule results are still saved for the next
run.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@ondrejmirtes
ondrejmirtes merged commit de22776 into phpstan:2.3.x Oct 28, 2026
608 checks passed
@ondrejmirtes

Copy link
Copy Markdown
Member

Thank you.

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