Mago 0.2.0 introduces several exciting features, including enhanced PHP version management, improved configuration options, and new compatibility checks. This release is a major step toward providing more robust PHP support and seamless developer experience.
🆕 PHP Version Management with mago-php-version
We’ve introduced the new mago-php-version
crate, which manages PHP versions with precision and efficiency. This crate:
- Handles PHP versions in
(major, minor, patch)
format, packed into au32
for easy comparison. - Supports version-based feature detection and deprecation checks.
- Provides a clear API for working with PHP versions, such as
PHPVersion::new(8, 4, 0)
orversion.is_supported(feature)
.
This crate powers new features and configuration options in Mago, ensuring accurate compatibility with PHP features.
⚙️ New Configuration: php_version
A new php_version
entry has been added to the configuration file, allowing you to select the PHP version your project targets. For example:
php_version = "8.4"
Mago now supports PHP versions from 7.4 to 8.4. Any version outside this range will result in an error, ensuring your code aligns with supported PHP versions.
🧰 New Compatibility Plugin
The new compatibility plugin for the linter checks your code for PHP features that are incompatible with the configured PHP version. For example:
- Using named arguments before PHP 8.0.
- Using asymmetric visibility modifiers before PHP 8.4.
This plugin ensures your code remains compliant with the selected PHP version, reducing compatibility issues.
🔍 Enhanced Rule Documentation
The mago lint --explain plugin/rule
command now includes PHP version compatibility information for each rule. If a rule is enabled but incompatible with the configured PHP version, it will be skipped automatically, and the explanation command will indicate the applicable version range.
Mago 0.2.0 focuses on precision, compatibility, and developer empowerment, making PHP development smoother than ever. We look forward to your feedback as we continue to improve!