Home>Article>Development Tools> PHPStorm2022.1 is officially released! See what functional improvements have been made?

PHPStorm2022.1 is officially released! See what functional improvements have been made?

WBOY
WBOY forward
2022-04-19 14:37:58 4683browse

This article brings you relevant knowledge aboutphpstorm, which mainly introduces issues related to the official release of version 2022.1, including improved Blade and Twig support and new advanced PHP metadata functions , generics in the @method annotation and some improvements to the editor. I hope it will be helpful to everyone.

PHPStorm2022.1 is officially released! See what functional improvements have been made?

Recommended study: "phpstorm tutorial"

PhpStorm 2022.1 is officially released! This version includes improved Blade and Twig support, new advanced PHP metadata features, generics in the @method annotation, and some improvements to the editor. The following excerpts introduce some of the new features:

Enhancements Support for Blade templates

Previously, PhpStorm treated each code block in Blade templates as a separate scope, which caused some issues such as missing code completion:

PHPStorm2022.1 is officially released! See what functional improvements have been made?

PhpStorm 2022.1 has major changes to how the IDE handles Blade templates, now with better code completion in the .blade.php file:

PHPStorm2022.1 is officially released! See what functional improvements have been made?

Further issues with code completion and formatting in Blade templates have also been resolved:

  • WI-37741 Autocompletion of PHP variables in Blade

  • WI-34830 Blade: support namespaces in php

  • WI-64460 Blade: missing completion for methods inside tags if there is php block()

  • WI-64463 Blade: Two consecutive @php fragments are merged together and produce an "expected: expression" warning

  • WI-31196 Blade: html comment Format error

  • WI-40358 Blade: @section inside @if block throws "Directive not closed"

  • WI-64594 Blade: Support for @js directives

See the full list on the bug tracker for more information.

Improvements to Twig templates

New option to disable tag auto-completion

Some users want their Twig tags to not automatically complete after typing {% will be turned off automatically, this behavior is now configurable:

PHPStorm2022.1 is officially released! See what functional improvements have been made?

#If you update the start and end tags from {% to {{ , the start and end will now also be edited at the same time mark.

WordPress Improvements

Jump from Hook call to registration

In PhpStorm 2022.1, there is a gutter icon to the left of the call. Click it to see a list of hook usage, including registrations and other calls.

PHPStorm2022.1 is officially released! See what functional improvements have been made?

Support for dynamic paths using get_template_directory_uri()

This release adds support for the get_template_directory_uri() function in paths.

PHPStorm2022.1 is officially released! See what functional improvements have been made?

Multi-line and nested array shapes

PhpStorm 2022.1Added complete support for multi-line and nested array shapes in PHPDoc and properties Support:

PHPStorm2022.1 is officially released! See what functional improvements have been made?

In this case, the array structure can be defined using the array shape annotation to get code completion for the keys and infer the type of the values.

Booth PHPDoc and Attribute syntax can also be used in PhpStorm, which supports return type and parameter type definition:

PHPStorm2022.1 is officially released! See what functional improvements have been made?

In addition to multi-line and nested comments In addition to support, there are many other improvements to array shapes.

Generics in @method annotations

PhpStorm 2022.1 supports generic types in @method definitions:

PHPStorm2022.1 is officially released! See what functional improvements have been made?

New Advanced PHP Metadata Features

In addition to built-in "code awareness" capabilities, PhpStorm also relies on external code knowledge. This knowledge comes in the form of PHP stubs and .phpstorm.meta.php files.

Support magic __call and __callStatic

Previously if you relied on __call or __callStatic of magic methods, you may lose its auto-completion function because these methods are undefined. In 2022.1 EAP, it is possible to add corresponding metadata entries and get autocompletion for such calls:

PHPStorm2022.1 is officially released! See what functional improvements have been made?

# Even dynamic calls can be automatically handled, receiving from parameter values Specific method name:

PHPStorm2022.1 is officially released! See what functional improvements have been made?

Support for @|MyClass type

You can now specify a union type as @|MyClass:

PHPStorm2022.1 is officially released! See what functional improvements have been made?

In Learn more about other metadata features in the documentation.

New Composer Project Wizard

Enhanced New Project Wizard: When creating a new empty project, you can choose to automatically generate a composer.json file for it, and Provide required dependencies.

PHPStorm2022.1 is officially released! See what functional improvements have been made?

After creating the project, PhpStorm will prompt you to install them:

PHPStorm2022.1 is officially released! See what functional improvements have been made?

WebDAV supports

This release introduces support for deployment using a WebDAV server. To configure a new server, go to Preferences | Build, Execution, Deployment | Deployment and add a new server of type WebDAV and provide the connection parameters:

PHPStorm2022.1 is officially released! See what functional improvements have been made?

Override Rsync command line parameters

PhpStorm 2021.3 introduces Rsync for SFTP support to significantly speed up deployments. The Rsync tool is executed with the -zar command line option, which compresses the transferred data (z), preserves permissions, ownership, and timestamps of transferred files and folders (a), and recurses into subdirectories (r).

In this release it is possible to customize the set of options: go to Settings | Preferences | Tools | rsync and provide the desired set of options:

PHPStorm2022.1 is officially released! See what functional improvements have been made?

New Checks

A number of new checks have been added designed to simplify the use of regular expressions.

Redundant Modifiers

The following new check will report modifiers used in regular expression patterns, but do not affect matching:

/i (case-insensitive) In a pattern that does not contain letters

/D( PCRE_DOLLAR_ENDONLY ) In a pattern that does not contain a dollar sign, or contains the \m(PCRE_MULTILINE) modifier

/s (dot matches newline character) In modes that don't contain dots

PhpStorm provides an Alt Enter quickfix to quickly remove these modifiers.

PHPStorm2022.1 is officially released! See what functional improvements have been made?

Unsupported modifier

The /e modifier is deprecated in PHP 7.0 and later.

PHPStorm2022.1 is officially released! See what functional improvements have been made?

New notification tool window

Replaced the event log instance with a new notification tool window, which can help users better understand notifications from the IDE. By default, the new tool window is located in the lower right corner of the IDE window, and notifications can be divided into two categories: Suggestions and Timeline.

PHPStorm2022.1 is officially released! See what functional improvements have been made?

Markdown improvements

Run commands from Markdown files

README files are generally used to describe the running steps of a software, PhpStorm 2022.1 will allow Run commands directly from such Markdown files - just click the run icon in the gutter to the left of the command.

PHPStorm2022.1 is officially released! See what functional improvements have been made?

New options can be managed via Detect commands, which can be run directly from Markdown files in Preferences / Settings |

Copy Markdown code snippet

The new version adds a new copy code snippet operation to the Markdown block, which can quickly copy Markdown code to the clipboard.

PHPStorm2022.1 is officially released! See what functional improvements have been made?

Code reformatting in LightEdit mode

In LightEdit mode, you can quickly edit files without creating or loading an entire project. Code can now be reformatted in LightEdit mode as well.

Improvements to Vue

JetBrains’ IDE 2022.1 version has made many improvements to Vue 3. PhpStorm integrates all of WebStorm’s improvements to HTML/CSS/JS and other web technologies. In this release, if you define components as global, the IDE will recognize them in your .vue files.

PhpStorm also correctly supports the createApp syntax, which will correctly match applications created using createApp related elements.

PHPStorm2022.1 is officially released! See what functional improvements have been made?

It’s a pity that there is no cracked version

Recommended learning: "phpstorm tutorial"

The above is the detailed content of PHPStorm2022.1 is officially released! See what functional improvements have been made?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:Laravel技术社区公众号. If there is any infringement, please contact admin@php.cn delete