Skip to content

ref(util): Match debug_backtrace native type in CodeLocationResolver @var to drop PHPStan baseline entry - #2393

Merged
Litarnus merged 1 commit into
masterfrom
ref/code-location-resolver-drop-var
Nov 19, 2026
Merged

Litarnus merged 1 commit into
masterfrom
ref/code-location-resolver-drop-var

Conversation

@sentry-junior

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

Copy link
Copy Markdown
Contributor

Removes this PHPStan baseline entry:

  • src/Util/CodeLocationResolver.php: PHPDoc tag @var with type list<array{function?: string, ...}> is not subtype of native type list<array{function: string, ...}> (varTag.nativeType)

CodeLocationResolver::resolve() annotated the debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS) result as list<StacktraceFrame>, which is wider than what PHP returns (function is optional, type is any string). The @var now states the actual frame shape: required function, type of '->'|'::', and no args, which DEBUG_BACKTRACE_IGNORE_ARGS omits. That shape still satisfies the list<StacktraceFrame> param of resolveFromBacktrace().

Nothing breaks: only the docblock changes, and runtime behavior stays the same. The @var stays in place because Mago needs it to type the resolveFromBacktrace() argument.

via automation sched_a59acc45df166a80a839d0b32321e740 · Run ID sched_a59acc45df166a80a839d0b32321e740:1794992400000.

--

View Session [Sentry]

@Litarnus
Litarnus marked this pull request as ready for review November 19, 2026 09:56
@Litarnus
Litarnus requested review from a team and stayallive as code owners November 19, 2026 09:56
@Litarnus
Litarnus merged commit 9cbcd08 into master Nov 19, 2026
59 checks passed
@Litarnus
Litarnus deleted the ref/code-location-resolver-drop-var branch November 19, 2026 10:11
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