Retire the method.alreadyNarrowedType ignore by naming each read
Follow-up to [#3619890]. Five assertions in two test classes were covered by an ignore reading "assertions the analysis folds to a constant because it cannot model what changes between them: a service resolved from the container, config read back after a form submit, and an event collector a dispatch appends to."
The diagnosis is right, and the ignore is not needed for it. phpstan remembers the type of a call expression and carries it forward, so a second reading of the same expression is judged against what the first assertion proved rather than against what happened in between. Reading each call into a variable named for its moment gives the analysis a fresh expression to type, and says at the call site which side of the change is being asserted.
Every read has to be named, the first included: it is the earliest assertion that pins the expression, so leaving that one inline keeps the later ones folded. That is why this touches four reads in WorkflowVariablesUiTest rather than the one the error pointed at.
Checked
With the method.alreadyNarrowedType block gone from phpstan.neon, phpstan reports nothing across the project at the level and configuration it already ships. NotifyTimeoutTest passes locally; WorkflowVariablesUiTest is functional and left to the pipeline. The assertions keep their arguments, so only the variable each one reads has changed.
Not touched
The other four ignores in that file, which look right: the getUserInput() coalesce stands on a core docblock that is wrong where removing the guard breaks three kernel classes at run time; AccountRecipient carries @api, so its wider signature is a promise rather than an oversight; and RemoteOrchestraClientTest reads always-true on one lane and always-false on the next-major lane, which no single edit satisfies.
AI-Generated: Yes (Claude Code found this while raising phpstan in another project, reproduced it here, made the change and drafted this description. I reviewed it before pushing.)