Repository navigation
ref(tracing): Drop Transaction::$transaction redeclaration to remove Mago baseline entry - #2398
Conversation
…Mago baseline entry
Litarnus
left a comment
There was a problem hiding this comment.
We cannot just drop the property and still keep it assigned. This will make the property dynamic which is bad
|
Thanks for looking at this. I don't think the property becomes dynamic, though. I checked this on this branch with PHP 8.4 and
If you'd still rather keep the explicit redeclaration in |
|
ok fair, I didn't read the description properly |
Removes this Mago baseline entry from
analysis-baseline.toml:src/Tracing/Transaction.php·incompatible-property-type· PropertySentry\Tracing\Transaction::$transactionhas an incompatible type declaration from docblock.Transactionredeclared theprotected $transactionproperty fromSpanonly to narrow its docblock fromTransaction|nulltoTransaction. A mutable property's docblock type cannot be narrowed in a child class, so Mago flags it. The narrowing was only needed for one call,DynamicSamplingContext::fromTransaction($this->transaction, ...)ingetDynamicSamplingContext().Transactionisfinaland its constructor sets$this->transaction = $this, which nothing else reassigns, so that call now passes$thisdirectly and the redeclaration is dropped. The inheritedSpan::$transactionproperty is still set in the constructor, sogetTransaction()andstartChild()behave the same.via automation
sched_a59acc45df166a80a839d0b32321e740· Run IDsched_a59acc45df166a80a839d0b32321e740:1795078800000.--
View Session [Sentry]