Skip to content

ref(options): Type the nested option base in OptionsResolver to drop Mago baseline entry - #2429

Merged
stayallive merged 1 commit into
masterfrom
ref/options-resolver-branch-base
Nov 27, 2026
Merged

stayallive merged 1 commit into
masterfrom
ref/options-resolver-branch-base

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Removes one entry from the Mago baseline (analysis-baseline.toml):

  • src/OptionsResolver.php — mixed-assignment: "Assigning mixed type to a variable may lead to unexpected behavior." (count 2, in applyOptions())

applyOptions() picked the base for a nested option in two steps: it assigned $resolved[$option] ?? null, then overwrote it with $default when that wasn't an array. Both assignments were mixed, and the @var array<string, mixed> $base annotation only came later. The base is now picked in one ternary, with the existing @var moved onto that assignment.

This is safe because the selection logic is unchanged: an existing array value is still used as the base, and anything else still falls back to the default. The @var was already asserting the same type for the recursive applyOptions() call.

via automation sched_a59acc45df166a80a839d0b32321e740 · Run ID sched_a59acc45df166a80a839d0b32321e740:1795770000000.

--

View Session [Sentry]

@stayallive
stayallive marked this pull request as ready for review November 27, 2026 15:42
@stayallive
stayallive requested a review from a team as a code owner November 27, 2026 15:42
@stayallive
stayallive merged commit 940bdb5 into master Nov 27, 2026
59 checks passed
@stayallive
stayallive deleted the ref/options-resolver-branch-base branch November 27, 2026 15:42
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.

1 participant