PHP Tools for Visual Studio v1.85.17401
Released: May 20, 2025
v1.85.17401 での更新項目
機能
- Smarter Type Handling and Inference:
- First-Class Callable Syntax: Added proper type handling for the new first-class callable syntax introduced in PHP 8.1. This resolves type inference issues with callable references.
- Instanceof Inference: Improved type inference when using the
instanceof operator, making conditions and smart casts more reliable.
- Dynamic Properties: Enhanced support for type inferring dynamic fields when the
__get() magic method is defined.
- Control Flow Analysis: Several updates were made to improve the accuracy of control flow analysis, leading to better detection of unreachable code, type narrowing, and possible errors.
explode() Return Type: Corrected type inference for the explode() function to avoid incorrectly including bool as a possible return type in PHP 8 and later.
- Enhanced Code Actions:
- Convert to Arrow Function: Introduced a new code action that lets you quickly convert closures to arrow functions (
fn) when applicable.
- Improved
is_null() Refactoring: Refined the code action that replaces is_null() with strict comparison, especially in cases involving negation or complex expressions.
- Enhanced Documentation and Annotation Support:
- PHPDoc Enhancements:
- Added support for the
@param-closure-this tag, improving context awareness for closures.
- Added validation and support for the
@require-implements and @require-extends tags, ensuring annotated constraints are respected in inheritance.
- Integrated Stubs Update: Updated bundled PHP stubs to improve IntelliSense and type resolution for core functions and classes.
- Lambda Scope Handling: Adjusted handling of the
newScope context in lambda functions, improving member visibility checks and code completion in closures and anonymous functions.
- Performance:
- General performance improvements were implemented, resulting in a smoother development experience, especially in large codebases.
- Laravel-Specific Enhancements:
- Improved Type Inference: Enhanced understanding of Laravel-specific helper functions and dynamic return types.
- IDE Helper Compatibility: Better compatibility with the
_ide_helper.php file, including workarounds for improperly generated Eloquent classes.
- Eloquent Integration: Smarter autocompletion and type inference when using Eloquent models, especially when working with
Auth::user() and Request::user.
- IDE-Helper Hack Support: Ensures Laravel code completion remains functional even when relying on the common IDE-helper hack.
不具合の修正
- Stability: Various under-the-hood fixes to enhance overall editor and language server stability.
- Code Formatter: Fixed several formatting inconsistencies for a cleaner and more predictable code style.
- Closure Return Reference: Fixed an issue where returning a reference from a closure could lead to false-positive warnings.