Mago 1.6.0
This release brings new analyzer checks for class design enforcement, new linter rules for file organization, path-scoped ignore/exclusion support, formatter fixes, and numerous bug fixes across the board.
✨ Features
Analyzer
-
class-must-be-finalcheck: New opt-inenforce-class-finalitysetting that reports classes not declaredfinal,abstract, or annotated with@api/@psalm-apiwhen they have no children (#1054)[analyzer] enforce-class-finality = true
-
missing-api-or-internalcheck: New opt-inrequire-api-or-internalsetting that requires abstract classes, interfaces, and traits to have@apior@internalannotations, forcing projects to declare extensibility intent (#1055)[analyzer] require-api-or-internal = true
-
Path-scoped ignore entries: The
ignoreoption now supports scoping ignored codes to specific paths (#1037, #1043)[analyzer] ignore = [ "mixed-argument", { code = "missing-return-type", in = "tests/" }, { code = "unused-parameter", in = ["tests/", "src/Generated/"] }, ]
-
Literal types for enum properties: Enum
nameandvalueproperties now return literal types instead of genericstring/int, enabling more precise type inference (#1035, #952) by @veewee -
Severity level in code-count format: The
code-countreporting format now includes the severity level for each issue code (#987)
Linter
-
file-namerule: New rule that enforces file names match the class/interface/enum/trait they contain (#1049) -
single-class-per-filerule: New rule that enforces each file contains at most one class-like declaration -
Per-rule path exclusions: Linter rules now support path-based exclusions, allowing you to disable specific rules for specific directories (#1037)
[linter.rules] no-isset = { excludes = ["src/Legacy/"] }
-
no-issetandreadable-literalenabled by default: These rules are now enabled out of the box -
Removed deprecated rules: The deprecated
constant-type,no-boolean-literal-comparison,parameter-type,property-type, andreturn-typelinter rules have been removed — their functionality has been moved to the analyzer
Formatter
- PER-CS compatibility:
inline-empty-function-bracesandinline-empty-method-bracesnow default totrue, matching the PER Coding Style specification (#1053)
CLI
- Multiple
--onlyrules: The--onlyflag now accepts multiple comma-separated rules (#1046)
⚡ Performance
foldhashreplacesahash: Switched tofoldhashfor faster hashing across the codebaseArc<T>replacesBox<T>in codex: Improves cloning performance for shared metadata
🐛 Bug Fixes
Analyzer
- Switch statement type narrowing: Non-exhaustive
switchstatements no longer incorrectly narrow variable types, preventing false redundant null-check warnings (#1038) - Type alias resolution in
@vardocblocks: Imported type aliases are now correctly expanded in@vardocblock annotations (#1029, #1030) - Type alias resolution in template extends: Imported type aliases are now resolved before being used as template arguments in
extends/implements(#1040) - Template inference for non-generic objects: Non-generic named objects are no longer incorrectly included in template inference, preventing false positives (#1036)
FORCE_COLORsupport: TheFORCE_COLORenvironment variable is now respected in reporting output (#1042)- CLI argument parser: Disabled enum variants are no longer shown in CLI argument parser output
Linter
readable-literalfalse positive on floats: Fixed the rule triggering on float literals like123.45where neither side of the decimal benefits from separators, producing a no-op suggestion
Formatter
- Empty array line break: Fixed incorrect line break added at the end of empty arrays (#1047, #978) by @Zuruuh
- Laravel Pint preset parity: Updated the Pint preset to match actual Laravel Pint formatting behavior (#1052) by @nikspyratos
Prelude (Type Stubs)
array_walkgenerics: Added generic templates toarray_walkfor proper type inference (#1045)curl_multi_execsignature: Corrected the signature ofcurl_multi_exec(#1033)setcookieduplicate: Removed duplicate definition forsetcookiethat only accepted the old syntax (#1032)
Documentation
- Fixed typo on homepage (#1028)
🔒 Security & CI
- GitHub artifact attestations: Build artifacts now include provenance attestations for supply chain security (#948)
- Explicit permissions: GitHub Actions workflows now use explicit permissions
- CD caching: Improved CI/CD pipeline with build caching
- Removed deprecated
attydependency
🏗️ Internal
- Bump
timefrom 0.3.46 to 0.3.47 (#1039) by @dependabot - Disable incremental build and add memory-debug profile
- Update sponsors list
🙏 Thank You
Contributors
A huge thank you to everyone who contributed code to this release:
Issue Reporters
Thank you to everyone who reported issues and requested features that shaped this release:
- @bendavies — #1040
- @ddanielou — #1045
- @JnsCas — #1049
- @KorvinSzanto — #1053, #1054, #1055
- @llaville — #987, #1028, #1042, #1043
- @mytskine — #1032, #1033
- @nikspyratos — #1037, #1046
- @scop — #948
- @veewee — #952
- @WalterWoshid — #1029, #1030, #1036, #1038
Full Changelog: 1.5.0...1.6.0