github carthage-software/mago 1.13.2
Mago 1.13.2

11 hours ago

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 set hook was incorrectly reported as reading a write-only property. In PHP 8.4, backed properties always have an implicit get that returns the backing value — only virtual properties with a set-only hook are truly write-only (#1226)
  • False possibly-undefined keys 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 yield in ternary expressions: Fixed a bug where the formatter removed necessary parentheses around yield expressions used as operands in ternary or elvis expressions, producing invalid code (#1231)

Reporting

  • Non-deterministic output ordering: Fixed an issue where running mago analyze multiple 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_* and proc_open functions in the built-in stubs (#1239)

⚡ Performance

  • Faster type equality checks: Added fast paths in TUnion::eq to short-circuit common cases (#1225)
  • Reduced allocations in formula clause filtering: Avoid unnecessary allocations when filtering formula clauses during analysis (#1224)
  • Optimized Binary::span edge 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

Don't miss a new mago release

NewReleases is sending notifications on new releases.