github carthage-software/mago 1.0.0-rc.3
Mago 1.0.0-rc.3

6 hours ago

Mago 1.0.0-rc.3

🤩 Features

💻 CLI

  • --retain-code option: Filter reported issues by specific codes (e.g., --retain-code semantics --retain-code invalid-argument). Unlike --only in lint, this runs all checks but filters the
    output

✨ Formatter

  • Method sorting: Add option to sort class methods based on name, visibility, and other modifiers

🐛 Bug Fixes

🎯 Type System

  • Variance-aware inheritdoc: Respect contravariance for parameters (allow child to widen types) and covariance for return types (allow child to narrow types) when inheriting docblock types (closes
    #629)
  • Better type narrowing: Narrow mixed to array types after isset() checks on nested array access
  • Nullsafe operator: Propagate nullsafe operator short-circuit through entire expression chains
  • Promoted properties: Parse inline @var docblocks on promoted constructor properties
  • Trait self types: Support self parameter types in closures defined in trait methods
  • Array operations: Preserve non-empty flag in array addition and array_merge() type inference
  • Type expansion: Correct type expansion logic for specialized type parameters

🔧 Linter

  • str-contains rule: Add support for negation pattern (strpos === false!str_contains). Only provide fixes for strict equality (=== and !==) to prevent unsafe replacements. Report warnings for loose equality (==, !=, <>) due to strpos returning 0 at position 0 (closes #494)

📚 Prelude

  • mbstring functions : Correct return types for encoding functions (closes #628)

🎨 Improvements

📁 Database

  • Path handling: Prioritize includes over paths, and add support for path and include patterns (closes #327)

Full Changelog: 1.0.0-rc.2...1.0.0-rc.3

Don't miss a new mago release

NewReleases is sending notifications on new releases.