May 2024 (version 1.80)

Welcome to the May 2024 release of PHP Tools for Visual Studio! There are a lots of internal improvements, enhanced performance, lower memory usage, updates to PHP stubs, PHPDoc sytaxes, and more.

Code Analysis and IntelliSense

  • Respects /** @ignore $variablename */ so if the $variablename is unused, the problem is not reported.
  • Supports more complex conditional return type, i.e. @return ($name is class-string<T> ? T : bool) (#538).
  • Fixes false unreachable code warning (#556).
  • Inline suggestion after namespace.
  • Diagnostic for possibly wrong foreach variables.
  • Override dignostic respects possible class_alias of the type hints.
  • Override dignostic underlines trait use, it the trait introduces an incompatible method.
  • Type inferring improvements.
  • Handling some invalid PHPDoc type annotations.

Code Actions

  • New code action to change define to const if applicable.
  • Code action to fix invalid casing of string PHPDoc type hint.
  • And more!

Rename Refactorings

This update adds correct rename refactoring for function/class/constant aliases, and for generic template arguments including @type imports and aliases. Correct rename for callbacks and symbols in PHPDoc comments have been implemented as well.

rename refactoring for template/generic types and aliases

Rename refactoring has been cleaned up and partially reimplemented in general.

Thanks to these internal chages, it will be now possible to introduce rename refactoring for named arguments and namespaces.

Improvements

  • Performance improvements.
  • Memory use optimizations.

Known Issues

  • Closing project/solution may cause a memory leak (happens in previous versions as well). Workaround: After closing a larger PHP project it is recommended to close and re-oopen Visual Studio.

Fixes

  • Formatter: Fixes unwanted space before named arguments which happens to be keywords as well. #555
  • Formatter: Fixed unwanted new line after chained method call #1969
  • Fixes override checks for static return types.