Mago 1.0.0-rc.3
🤩 Features
💻 CLI
--retain-codeoption: Filter reported issues by specific codes (e.g.,--retain-code semantics --retain-code invalid-argument). Unlike--onlyin 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
@vardocblocks on promoted constructor properties - Trait
selftypes: Supportselfparameter 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 tostrposreturning 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