Skip to content

Mago 1.45.0

Latest

Choose a tag to compare

@github-actions github-actions released this 24 Jul 04:45
1.45.0
8771af7

Mago 1.45.0

This release teaches the analyzer to build keyed array shapes from get_object_vars(), adds @param-closure-this support and an auto-fix for overly-wide return types, introduces a linter rule preferring DateTimeImmutable::createFromTimestamp(), fixes a batch of analyzer false positives, and makes empty reports valid SARIF/JSON documents for CI.

✨ Features

Analyzer

  • get_object_vars() shapes: returns keyed array shapes built from the object's visible properties. (#2110, a729ce1)
  • @param-closure-this: supports the docblock tag for typing a closure parameter's $this. (#2131, 6000d41)
  • Overly-wide return types: adds an auto-fix that narrows the declared return type. (#2068, #2120, 9e4d186)

Linter

  • prefer-datetimeimmutable-create-from-timestamp: suggests the factory over new DateTimeImmutable('@...'). (#2118, 38b6152)

🐛 Bug Fixes

Analyzer

  • Readonly promotion: detects reinitialization of promoted readonly properties in parent constructors. (#2127, 490452e)
  • Escaping breaks: preserves breaks that escape nested loops in reachability analysis. (#2124, 635eeab)
  • Guarded members: tracks method_exists guards on descendant members. (#2125, d1b6e9c)
  • PSL analysis: eliminates false positives when analyzing PSL-based code. (6527f24)
  • array_map shapes: preserves array shapes for untyped closures. (#2122, 816578a)
  • Catch variables: refines definedness for precise conditions in try/catch. (#2119, aa469b9)
  • Hooked properties: tracks property-hook writes against the read type. (#2112, bd95ea5)
  • Split property types: supports distinct @property-read and @property-write types. (#2079, #2108, b54a881)
  • @property visibility: resolves tags according to call-site visibility. (#2106, a4b077d)

Codex

  • Enum case literals: infers literal values from class constants, tightening integer conditions. (#2111, 237465e)

Prelude

  • array_diff: relaxes value parameters to string-castable types. (#2116, f290239)

Reporting

  • Empty reports: emits valid SARIF, JSON, GitLab, and Checkstyle documents when there are no issues. (#2128, 003ff32)

Playground

  • Analyzer settings: forwards playground settings so they take effect. (#2121, 4184888)

🙏 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.44.0...1.45.0