What’s New in PhpStorm 2022.2

PhpStorm 2022.2 is a major update that brings support for Mockery and Rector, enhanced support for generics and enums, improvements to our debugger and HTTP client, and more.

Mockery support

PhpStorm 2022.2 introduces support for Mockery, the popular mock object framework. We have autocompletion support for most Mockery functionality, inspections that help improve your workflow, interface mocking, and much more.

Rector support

A second major addition in this release is support for Rector, the automation tool for managing PHP upgrades and bulk refactorings.

You can now run Rector from PhpStorm, review file changes with our handy diff view, and manage its configuration in depth.

PHP generics

Finally, we keep improving the support for generics. With this release, we’ve added support for minimum and maximum values of integers and improved support for collections, in addition to improving type inference from closures. You can read about these changes in depth in this blog post.

Highlight failed test assertions

Whenever one of your test assertions fails, PhpStorm will highlight the exact line where it failed and will allow you to rerun the test from the failed line using a new context menu suggestion. Just press Alt+Enter on the failed line to rerun that specific test.

Creating enums

You can now create enums from the Create Class dialog. Make sure your project’s PHP version is set to 8.1 or later, otherwise the enum option won’t show.

Debugger improvements

We’ve made several quality-of-life improvements to our debugger window, so that relevant data is always close at hand.

When debugging an object, the pseudo-variable will always be shown on top in the Variables pane:

Additionally, we’ll show the contents of an array in the variables pane so that you don’t need to manually open it:

And finally, whenever an object implements the __toString() method, we’ll show the textual representation of that object in the Variables pane as well.

Clickable URLs

PhpStorm 2022.2 adds support for clickable URLs in several file formats. Whenever a URL is found in a PHP, JSON, YAML, or properties file, PhpStorm will highlight it and allow you to click it to open it in a browser.

Running current files

We’ve introduced an improved version of the Run Current File functionality that is available from the Run/Debug widget. The widget now features a secondary menu that offers applicable runners along with the Run with Parameters action, which lets you tune the run configuration parameters before running the file.

HTTP client improvements

We’ve updated our HTTP client to support both WebSockets and GraphQL.

On top of that, we made improvements to the UX of our HTTP client. You can select a run environment using an icon on the gutter.

We also introduced a status bar in the Response view.

Changing the editor’s font size

You can now change the editor’s font size across all tabs using keyboard shortcuts. We’ve also added a useful Reset button to revert your font size changes back to the original size.

Support for Angular standalone components

We’ve been actively working on support for Angular 14 in PhpStorm. The most important addition we’ve made in this release is support for Angular standalone components. PhpStorm now properly recognizes components, directives, and pipes marked as standalone: true.

Updates for Vue 3

Our support for Vue 3 has lagged behind some of the latest Vue updates. We’ve shipped several improvements to address this, though some, such as Vite support, were already included in the minor updates for v2022.1. PhpStorm 2022.2 also comes with a few fixes. For example, it understands type narrowing in v-if/else directives.

TypeScript 4.7 support

PhpStorm 2022.2 comes bundled with TypeScript 4.7, supporting new language features like moduleSuffixes and ESM in Node.js. It will automatically insert the .js extension to the import statement if the module is set to node16 or nodenext in your tsconfig.json file. Additionally, PhpStorm supports the typesVersions field in package.json files.

JetBrains Runtime

With this release, we are moving from JetBrains Runtime 11 (JBR11) to JetBrains Runtime 17 (JBR17). This will have the following effects:

  • A significant performance improvement that will make the IDE operate faster and more smoothly.
  • Better security, as JBR17 is based on the latest OpenJDK LTS.
  • Better rendering performance on macOS, as JetBrains Runtime 17 leverages the Metal API.
  • Increased accessibility on macOS, as JBR17 features integration with the VoiceOver screen reader.
  • Further performance improvements thanks to the usage of the Vector API.

Markdown table of contents

We’ve been working on making our Markdown support better. In this release, we’ve added a new Generate Table of Contents action that will make creating a table of contents for your Markdown files much more straightforward. You can use Alt+Insert, which brings up the Insert… popup. You can then select Table Of Contents, which will be generated automatically for you.