September 2024 (version 1.82)

Welcome to the September release of PHP Tools for Visual Studio. This update improves stability, improves existing refactoring and IntelliSense features, and adds new code formatting options.

Formatter Blank Lines Settings

PHP code formatter has a whole new group of settings Blank Lines for adjusting blank lines between various kinds of code sections. You can adjust spaces above declarations, class bodies, comments, functions, and more. See the settings in Visual Studio, Tools/Options/Text Editor/PHP.

Blank Lines Settings

Features

  • Checking for PSR-4 autoload rules, class names, and file names. Quick Fix for PSR-4 file name mismatch (#609).

Improvements

  • Respects class-string<T> annotation when accessing static class members through indirect type.
  • Property access visibility check.
  • Type inferring improvements, @global tag inherited from base if necessary.
  • Refactoring suggestion switch->match only for PHP>=8 (#2098).
  • Refactoring and find-references resolving dynamic member access to get better results (#2093).
  • Class constant and enum case checks are correctly case-sensitive.
  • Generic type arguments syntax accepts * token.
  • Updated integrated PHP manual, adds SimpleXmlElement::saveXml.
  • More checks for parameters passed by-ref.
  • Fixes invalid type inferring after is_numeric().
  • Fixes incorrect refactoring suggestion of A ? A : B. Instead ?: is correct.
  • Fixes override checks with implicit nullables, never, and traits.
  • Fixes use of Function keyword in a namespace name.
  • Fixes use of Collection<T> with just a single generic type parameter.
  • Magic constants (__METHOD__, __PROPERTY__, etc.) are checked if they are used in a correct context.
  • Diagnostics improvements, fixes for try/finally control flow and reachability analysis.
  • Improved type inferring.

Fixes

  • Fixes unwanted transformation of FILTER_NULL_ON_FAILURE constant to lowercase #2085.
  • object type hint respecting structured object phpdoc type hint.
  • Code completion works after multiple :: expression chain.
  • Fixes binding of template type arguments in inferred types #2106.
  • Fixing variables completion inside double-quoted strings.
  • Fixes mouse hover for typed const declaration.
  • Fixes false warning for using @extends on interface.
  • Keeps @internal functions in packages cache (i.e. keeps them in IntelliSense).
  • Fixes argument type check for self.
  • Fixes use of @suppress above function or class.
  • Fixes an issue causing unwanted spaces after formatting require and similar statements.
  • Fixes an issues when formatting complex expressions in array initializers.
  • Fixed an issue where unwanted line wrapping occurred in code blocks during formatting. #2057