Announcing availability of PHP Tools v1.74 - for Visual Studio 2019 and Visual Studio 2022. The update introduces exciting new features!
Introducing AI-powered inline code predictions enhancing productivity and code development experience for PHP. Devsense's IntelliPHP leverages machine learning to provide intelligent code predictions. As you type, the extension suggests relevant code completions and shows them as grey text in your editor. This feature helps you write code faster and reduces the time spent on manual typing.
The code predictions work completely offline, and do not send or receive any data to Internet.
Confirm the suggestion with TAB
key, or just keep typing and it adapts. Cancel the suggestion with ESC
key.
Security: The AI suggestions work completely offline, they don't send or receive any data to Internet, and they don't store any data locally either.
To disable/enable the feature, go to
Tools
/Options
,Text Editor
/PHP
/IntelliPHP
.Note, the feature is available for Visual Studio 2022 and separately for Visual Studio Code at marketplace.visualstudio.com.
IteratorIterator
IteratorIterator
and RecursiveIteratorIterator
are extended with generic type argument TInner
, @mixin TInner
, and their __construct()
infers this TInner
. Therefore, IntelliSense knows the inner iterator type and so it can provide inner iterator's members. (#1613)
@phpstan-type
, @psalm-type
, @phpstan-import-type
Since now, we have a basic support for local type aliasing.
Newly, trait
use can be annotated with @use
doc comment to specify the trait's generic arguments (#840), i.e.:
class MyClass {
/** @use MyTrait<int, string> */
use MyTrait;
}
static
TypeWe have reimplemented the internals and improved type analysis for various cases involving use of static
and $this
within traits, protected properties, and class inheritance in general. Moreover generic arguments and trait members are resolved better with more inherited type information (#931).
@phpstan-type
and @phpstan-import-type
are supported (#1543).phpstan.neon
(and .dist
alternatives) in containing directories processed; supporting their global type aliases (phpstan.neon
file's "typeAliases"
setting).Collection<TValue>
, Iterator<TInner>
correctly.__get()
reported with lower severity.use
with adaptation are analysed correctly giving unseful insights about missing method implementation.try
/finally
blocks.is_a()
analyzed correctly.__callStatic()
magic method.match
, fn
, and interface
are not reported as syntax errors when within a qualified name (PHP 8.0+).true
, false
, and null
type names. (#338)@ignore
tag as unknown./** @var */
above if
fixed.define()
. (#340)Trait function members are resolved in semantic highlighting, finding references, code lenses with method overrides, and rename refactoring.
.phar
files in the solution has been fixed.