PhpStorm 2022.3 is a major update that includes the new UI preview, PHP 8.2 support, Code Vision for PHP, the quick-fix preview, support for ParaTest, the rendered view for PHPDoc, Redis in database tools, and much more.
The brand new UI is available for everyone to try. It is turned off by default because it’s still in the Beta/Preview stage.
You can switch to the new UI in Settings/Preferences | Appearance & Behavior | New UI Preview.
The new UI is cleaner, has fewer distractions, and works faster while allowing you to do most things the way you're used to.
In this release you will find many additional visual improvements. Here are some of the most notable ones.
Right in the editor, next to the PHP code, you can see additional information about PHP symbols: class, trait, interface, method, or function.
You'll see usages number – no need to click on a symbol to find it out.
For classes and interfaces, you'll see the number of inheritors and implementations, respectively.
You'll also get information from Git about who made the most changes to a certain piece of code, allowing you to quickly see who is a code owner and has the most expert knowledge about that part of the code.
You can fix some code problems automatically by pressing Alt+Enter.
Now you will be able to preview the proposed quick-fix or intention before you apply it and see instantly how your code will be altered.
You can now change how PHPDoc blocks look in PhpStorm 2022.3 with an option that provides better-looking rendering and support for HTML formatting. This makes reading heavily annotated code more pleasant and easy.
To toggle the new rendered view, click on the gutter icon near any PHPDoc block.
To turn on rendering for all PHPDoc comments, right-click on the gutter icon and choose Render All Doc Comments.
If you press Ctrl+Q on any function, class, or method, PhpStorm will show documentation right in the editor.
This popup has been significantly reworked. Now you don’t need to switch to the browser and search for documentation, because everything is right in your IDE.
PhpStorm 2022.3 comes with full support for PHP 8.2. Most of the changes in the IDE will fit organically into your PhpStorm workflow, so we’ll only mention the new features that you need to know about.
A readonly class is a quick way to declare a class that has only readonly properties. You can use these classes for additional data integrity.
For readonly classes, PhpStorm provides:
Accessing non-existent properties in PHP 8.2 will cause a deprecation notice.
PhpStorm highlights these usages and provides quick-fixes for the errors, either by
adding the property, or by using the
PHP 8.2 adds support for disjunctive normal form types, as well as standalone
false types. We’ve added support for all of them in PhpStorm as well.
PHP 8.2 introduces a few more deprecations, and PhpStorm has you covered with corresponding inspections to spot them and quick-fixes to update your code.
If you need to use a variable inside a string, there used to be three possible ways for interpolation. One of them is now marked as deprecated and will be removed in the future.
PhpStorm will highlight the occurrences, and you can use an Alt+Enter quick-fix to upgrade the code.
Several ways of calling functions have been deprecated in PHP 8.2.
PhpStorm highlights invalid code, and you can use an Alt+Enter quick-fix to upgrade your code.
PhpStorm can scan your whole codebase at once to detect all possible problems. Go to Code | Analyze Code | Run Inspection by Name. Next, search for “dynamic property”, for example, and PhpStorm will do the rest.
If you’re having trouble configuring Xdebug, here are a few things you can now do in PhpStorm to identify the problem.
phpinfo() call to your PHP script or page and copy the output
of the function that you see in your browser. Then call
Run / Web Server Debug Validation, and you’ll see a dialog that allows you
to paste the
phpinfo() output from the previous step.
PhpStorm will analyze the server configuration and detect most common problems.
phpinfo() information didn’t help, you can use
PhpStorm’s validation script on the server.
Xdebug 3.2 has an extra “return from function” debugging step that allows you to inspect the return value.
PhpStorm 2022.3 supports this new feature. To trigger it, press Step Into when you’re on the last statement in the function. As a result, an additional variable will be shown in Watches.
The long-anticipated support for parallel testing in PhpStorm has finally arrived!
To run tests in parallel, you need to check the Use Paratest option in your
tests’ Run configuration, and check that the path to the ParaTest binary is set
correctly. Usually, if you have ParaTest added in your
then the path should look something like this:
It is now possible to choose an external formatter in Preferences | PHP | Quality Tools. You can now use FriendsOfPHP/PHP-CS-Fixer or squizlabs/PHP_CodeSniffer for this purpose.
A popular task runner for PHP, Robo, received the following extended support:
If you use the Prophecy mocking framework in your tests, working with it in PhpStorm will now be easier.
You don’t need to remember or look for
date() formats anymore. PhpStorm 2022.3
shows a tooltip with an example date when hovering on a date format string.
In addition, when editing a date format string, you’ll get an autocompletion with hints for all characters that are recognized as format parameters.
Support for array shape annotations was added in PhpStorm 2021.2, then in 2022.1, we added multiline and nested syntax support for array shapes.
The final piece that was missing is provided in PhpStorm 2022.3 – you’ll get full code completion for array-shape items in loops.
We merged two old synchronization solutions (IDE Settings Sync and Settings Repository) into a single one – the new Settings Sync. It allows you to reliably synchronize settings across different IDEs and machines.
If you weren’t using a settings synchronization solution before, but want to try the new one, you can enable it via Settings / Preferences | Settings Sync | Enable Settings Sync.
You can set up this type of connection in Settings / Preferences | Build, Execution, Deployment | Docker.
Call up the context actions (Alt-Enter) on the highlighted image name and then select Pull Docker image to pull a required image without running it from Dockerfile, docker-compose.yml, or even from tests using Testcontainers.
Get highlighting and completion in .dockerignore files.
Use multiline scripts right in your Dockerfiles.
Set up additional Docker connections using Docker Contexts by calling the Add Service context menu in the Services view and selecting Docker Connections From Docker Contexts.
The HTTP Client now provides better formatting options for requests with long URLs. You can also use the Put query parameters on separate lines context action to break the query into smaller fragments on different lines.
The HTTP Client now supports script blocks that are executed before requests. You can generate some data before request execution and pass it to the subsequent request using variables.
PhpStorm now provides the сrypto API, making it capable of computing the md5 or sha1 hash values for an HTTP request.
There are now more random functions available, which is convenient for quick API testing.
The New Project wizard available on PhpStorm’s Welcome screen now includes project templates for Vite and Next.js. We’ve also updated the project template for Vue to make sure it follows the latest standards.
PhpStorm can now take care of unresolved imports and will offer suggestions for importing Vue components. We’ve also supported the props destructure syntax, improved the behavior of code completion and type checking for Vue library component props, and fixed several Nuxt 3 issues.
PhpStorm now supports Vitest, a Vite-native unit test framework! You can run, re-run, and debug your tests in all of the key ways you’d expect, including through gutter icons. Also, watch mode is enabled with the All tests scenario by default. Snapshot testing and coverage are supported in watch mode, too, giving you near-instant feedback on coverage when coding.
These are the most important changes in this release, but of course, there are a lot more. Check out the release announcement on the PhpStorm blog for the full list of enhancements in this release.