Speed up Psalm analysis of activity and workflow jobs#402
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #402 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 666 670 +4
===========================================
Files 63 63
Lines 2267 2275 +8
===========================================
+ Hits 2267 2275 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rmcdaniel
force-pushed
the
agent/fix-psalm-activity-analysis
branch
from
July 19, 2026 18:29
871126d to
02af9b1
Compare
rmcdaniel
marked this pull request as ready for review
July 19, 2026 18:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #399.
Root cause
ActivityandWorkflowinitialized Laravel queue routing throughQueueable's fluent setters on the subclass-typed$this. Psalm specializes the trait's$thisreturn type for every job subclass, then repeatedly reports thatQueueable.phpcannot use its cache.The refactor in #401 does not touch that call path; the compact reproduction below remains at 19 total / 17 analysis-phase
Queueablereparses on both master and #401.Fix
ActivityorWorkflowreceivereffectiveConnection → onConnection → effectiveQueue → onQueueorderonConnection()/onQueue()dispatch, subclass defaults, and Laravel's enum normalizationResults
Pinned environment: PHP 8.5.8, Laravel 13.20.0, Psalm 6.16.1. All runs completed with no Psalm errors.
Queueablereparsesd502e26)8bf64429)A 120-activity amplification microbenchmark using one PSR-4 file per activity completed in 10.38s on master and 7.37s on this PR. Reparse counts fell from 963 to 3. With Psalm's cache warmed, they remained 962 on master and fell to 2 here.
Validation
composer ecscomposer stanCopy/paste Psalm reproduction
Expected output:
Both Psalm logs end with
No errors found!.