PhpStorm 2022.1

Integriert die Unterstützung für mehrzeilige und verschachtelte Array-Shapes, Inplace-Refactoring der Extraktionsmethode und vieles mehr.
April 20, 2022
Neue Version

Funktionen

  • Multiline and nested array shapes
    • Adds full support for multiline and nested array shapes in both PHPDoc and in #[ArrayShape] attribute (Previously only single-line and single-level annotations were supported.).
    • Add array shape annotations to get the code completion for the keys and infer the value types in simple array data structures or object-like arrays.
    • You can use both PHPDoc and Attribute syntax in PhpStorm, whichever you prefer. The syntax is supported for return types and parameter types.
  • Inplace Extract Method refactoring
    • 'Extract Method' is one of the most used refactorings in PhpStorm. In order to simplify code and create a new method, just select the piece of code and press ⌘⌥M (Cmd+Alt+M / Ctrl+Alt+M).
    • Previously, this would open a dialog for the refactoring configuration. Now, in many cases, for extracting a method you can use the inplace refactoring instead.
    • There will be no dialog, and a new method (or function) will be created right away in the editor. The cursor will be active to edit the name of the new method.
  • Enhanced support for Laravel Blade templates
    • Previously, PhpStorm treated every code block in Blade templates as an independent scope which often caused issues with code completions and insights.
    • This release significantly reworks how the IDE handles Blade templates. As a result, you’ll get better code completion in your .blade.php files.
  • Improvements for WordPress
    • Support for dynamic paths with 'get_template_directory_uri()' - In PhpStorm, you can ⌘+Click (Ctrl+Click) on file paths to open the corresponding files in the editor. That didn’t work for dynamic paths in WordPress code when the path was compounded with WordPress functions. In this release, support has been added for the get_template_directory_uri() function in paths.
    • Jump from hook invocation to registrations - The WordPress hook system is powerful, but it was not possible to jump from where a hook was called to where the handler is declared. Now there is a gutter icon to the left of an invocation. Click it to see the list of hook usages, including registration and other invocations.
  • New advanced PHP metadata capabilities
    • Support to magic __call and __callStatic - If you rely on the magic methods _call or _callStatic, then you would lose code completion for the methods, as they are not defined. In this release, you can add the corresponding metadata entry and get autocompletion for such calls. You can even automatically handle dynamic calls, receiving a specific method name from a parameter value.
    • Support union types - You can now specify union types as @|MyClass in .phpstorm.meta.php – this can improve the coding assistance for mocks.
  • Improved annotations support and generics
    • Improved support for annotation-based generics in PhpStorm. In this release, a few more cases have been covered, including, but not limited to:
      • @psalm-import-type.
      • @phpstan-import-type.
      • @psalm-trace.
      • @phpstan-trace.
      • Generics in @method tags.
  • New Composer Project wizard
    • When creating a new empty project, the option has been added to automatically generate a composer.json file for it and provide the desired dependencies. After the project is created, PhpStorm will prompt you to install them.
  • User Experience
    • New Notifications tool window - The Event Log instanсe has been replaced with a new Notifications tool window. It helps you maintain a better overview of the IDE notifications and reduces the chance of missing anything important.
    • Updated Structural Search and Replace dialog - The Structural Search and Replace dialog has been redesigned to feature a list of all the templates to make it easier to navigate through them. A Pin Dialog icon has also been added in the upper right corner of the Structural Search and Replace dialog.
    • Evenly split tabs - You can now evenly distribute the working space among editor tabs to have the same width.
    • Export UML diagram to other formats - Export UML diagrams as yEd .graphml, JGraph .drawio, Graphviz .dot, Mermaid .md, Plantuml, and IntelliJ IDEA .uml files, making them compatible with third-party tools.
  • Improvements for Markdown
    • Run commands from Markdown files - README files often describe the steps needed for running an app and list the commands you need to use. This release will let you run those commands right from the markdown file - just click on the Run icon in the gutter to the left of the command.
    • Copy code snippet for Markdown - Added a new Copy code snippet action to Markdown blocks, which will let you quickly copy their contents to the clipboard.
    • Updated Markdown Editor Floating Toolbar - The floating toolbar that appears on text selection has been reworked to make it easier to format Markdown files. In addition to the new design, the toolbar now lets you create lists and provides a menu for selecting header styles. The toolbar is customizable, so you can fill it with the options you need most.
  • VCS (Version Control)
    • Updated Annotate with Git Blame - Improved the functionality of Annotate with Git Blame to make investigating introduced changes easier. The IDE highlights the difference in the lines right in the editor when you hover on an annotation and opens the Git Log tool window when you click on it.
    • Suggested changes in pull request comments - It’s now easier to work with suggested changes in PhpStorm as you can now apply or commit changes locally, right in the IDE.
    • Updated Commit Details pane in Git tool window - The Commit Details pane now includes information about GPG signatures and build status. Previously, this data was shown only as a column in the Git log.
    • Git File History: new UI without index - The new UI for the Git File History tool window is now independent of the indexing process. The data is represented with a new interface even if the Log index is off.
PhpStorm

PhpStorm

PHP IDE mit Refactorings, Code-Vervollständigung, arbeitsbegleitender Code-Analyse und Ausrichtung auf die Codierungsproduktivität.

PhpStorm ist auch verfügbar in:

Sie haben eine Frage?

Live-Chat mit unseren JetBrains-Lizenzierungs-Spezialisten.