Mago 1.13.2
This is a patch release with several bug fixes across the analyzer, formatter, and prelude, along with a batch of performance improvements.
🐛 Bug Fixes
Analyzer
- False positive for backed properties with set-only hooks: Fixed a false positive where reading a backed property with only a
sethook was incorrectly reported as reading a write-only property. In PHP 8.4, backed properties always have an implicitgetthat returns the backing value — only virtual properties with a set-only hook are truly write-only (#1226) - False
possibly-undefinedkeys when building arrays in loops: Fixed a false positive where array shape keys were inferred as optional ('key'?: type) when building arrays incrementally inside a loop with conditional branches (#1230)
Formatter
- Parentheses stripped from
yieldin ternary expressions: Fixed a bug where the formatter removed necessary parentheses aroundyieldexpressions used as operands in ternary or elvis expressions, producing invalid code (#1231)
Reporting
- Non-deterministic output ordering: Fixed an issue where running
mago analyzemultiple times on the same codebase could produce diagnostics in a different order, making diff-based CI checks unreliable (#1232)
Prelude
- Incorrect function signatures: Corrected the signatures for
socket_*andproc_openfunctions in the built-in stubs (#1239)
⚡ Performance
- Faster type equality checks: Added fast paths in
TUnion::eqto short-circuit common cases (#1225) - Reduced allocations in formula clause filtering: Avoid unnecessary allocations when filtering formula clauses during analysis (#1224)
- Optimized
Binary::spanedge traversal: Reduced overhead when computing spans for binary expressions (#1229) - Reduced per-path overhead in file loading: Lowered per-path allocation costs in
load_paths(#1228) - Reduced sorting allocations in hierarchy populator: Fewer temporary allocations when sorting class hierarchies (#1233)
🙏 Thank You
Contributors
A huge thank you to everyone who contributed code to this release:
Issue Reporters
Thank you to everyone who reported issues that shaped this release:
Full Changelog: 1.13.1...1.13.2