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

latest release: 1.0.0-rc.9
4 hours ago

Overview

This release brings significant analyzer enhancements including full property hooks support, unused template parameter detection, and improved type assertion analysis. The linter gains a new variable-name rule, and the prelude is updated with MongoDB, Redis, and URI extension stubs.

Features

Analyzer

  • Unused Template Parameter Detection: The analyzer now detects and reports unused template parameters on classes, interfaces, traits, functions, and methods
  • Impossible Type Assertion Detection: Added detection for impossible type assertions in @assert annotations, helping catch logical errors in assertion docblocks
  • Negation Operator Validation: The analyzer now validates operand types for the negation (-) operator, catching type errors early

Codex

  • Full Property Hooks Support: Complete implementation of PHP 8.4 property hooks, including type inference, visibility checks, and backed property reference validation
  • Full properties-of<T> Support: The properties-of<T> type is now fully implemented with proper visibility filtering (public-properties-of<T>, protected-properties-of<T>, private-properties-of<T>)

Linter

  • New variable-name Rule: Enforces consistent variable naming conventions (snake_case or camelCase) with configurable options for parameter checking and promoted property exclusion (#695)

Bug Fixes

Analyzer

  • Fixed handling of by-reference values in array literals
  • Prevented duplicate catch type errors by inlining the avoid-catching-error heuristic check (#696)
  • Redundant negated type assertions (e.g., !is_string() on an int) are now reported as warnings instead of impossible errors
  • Removed incorrect assertion from fclose() stub

Linter

  • The literal-named-argument rule now skips the first argument by default, as it's typically self-explanatory. A new check-first-argument option preserves the original behavior (#694)

Playground

  • Fixed an issue where shared playground URLs would immediately lose their state upon loading

Documentation

  • Replaced outdated PSR-12 references with PER Coding Style (PER-CS) (#698)

Prelude Updates

  • New Extension Stubs: Added stubs for MongoDB, Redis, and URI extensions
  • Updated Stubs: Synced DOM, Intl, Reflection, and Standard extension stubs with phpstorm-stubs

Full Changelog: 1.0.0-rc.7...1.0.0-rc.8

Don't miss a new mago release

NewReleases is sending notifications on new releases.