The highlights of this major update include:
JetBrains AI Assistant is now generally available with a number of new and improved features to increase your productivity in JetBrains IDEs.
AI Assistant can now generate multi-line blocks of code for you. Simply start typing on a new line, and if an LLM suggestion is available, a grayed-out code snippet will appear. Press Tab to accept the suggestion.
Currently, such suggestions are available within class contexts or inside function definitions.
AI Assistant can also generate tests for class methods. With the caret placed on the class method you wish to cover with unit tests, just press Alt+Enter, select AI Assistant, and choose Generate Unit Tests.
Previously, you could use AI chat to generate code snippets. Now there is an AI Assistant | Generate code… action that opens a prompt right inside the editor. You will be asked to enter a description of the code you wish to generate. Once you do, AI Assistant will provide suggestions, and you can accept part or all of them.
Sometimes, when you execute a PHP script or run configuration, or run a Composer action, the job fails for some reason. AI Assistant can help you determine the root cause of the issue. Click the Explain with AI button in a stack trace or error message to get an AI-generated explanation.
Use AI Assistant in PhpStorm as a supplemental feature with a JetBrains AI Service subscription.
PhpStorm now supports the Pest test framework out of the box. We recently agreed with the original author of the Pest plugin to take over its development and bundle it in PhpStorm. You can read the details in our recent blog post.
Just like PHPUnit tests, Pest tests can now be run directly from PhpStorm. When you place your caret inside a test and trigger the run window, a run configuration will be created for that specific test. You can place the caret in the file but not inside any particular test to trigger all the tests in that file.
With this new Pest support, you can write assertions by calling functions or methods
on $this
. It also improves autocompletion in test functions, so you can see what
assertions are available as you type.
In Pest, you can write custom expectations to reduce boilerplate checks in your tests. PhpStorm can help you find usages of custom expectations and help you rename them.
PhpStorm 2023.3 comes with full support for PHP 8.3. Most of the changes in the IDE will be integrated organically into your PhpStorm workflow without you even noticing them, so we’ll only mention the new features you'll need to know about in order to benefit from them.
#[\Override]
attribute
PHP 8.3 introduces the new #[\Override]
attribute. It can be used to
explicitly show your intent when overriding a method. The PHP engine is able to check
whether a method marked with #[\Override]
actually overrides the parent
method, throwing an exception if this is not the case. PhpStorm 2023.3 gives you a
warning about such cases in advance.
PhpStorm also suggests adding the #[\Override]
attribute when applicable.
json_validate()
function
PHP 8.3 adds the new json_validate()
function to the standard library.
Previously, the only way to validate whether a string was valid JSON was to decode it
and detect whether any errors were thrown. PhpStorm can detect these patterns and
suggest replacing them with a json_validate()
function call. This can be
beneficial if you only need to know whether the input is valid JSON, since it uses less
memory compared to decoding the string.
In PHP 8.3, you can declare types for class constants. All type declarations can be
used except for void
, callable
, and never
.
For typed class constants, PhpStorm provides:
PHP 8.3 introduces a few deprecations, and PhpStorm has you covered with corresponding inspections to spot them.
PhpStorm 2023.3 brings various improvements for Symfony developers.
A new built-in project initializer for Symfony allows you to create new Symfony projects with the desired types and versions right from the Welcome screen.
You can now enjoy full IDE support for DQL inside QueryBuilder method calls. Features include highlighting, field completion, the ability to resolve to the target model class, and more.
Following the introduction of attributes in PHP 8.0, Doctrine annotations are being deprecated and will soon be removed. In order to help you make the switch, PhpStorm 2023.3 includes functionality for converting Doctrine annotations to attributes.
PhpStorm also supports the conversion of Symfony annotations to their corresponding
attributes, like #[Required]
,
#[Route]
, and so on.
As an experimental new feature, we’ve also added the ability to exclude directories that come from indexed libraries. Excluding such files from your project will help you avoid multiple-definition problems and improve indexing performance.
We continue to work on improving the experience of using generics. In PhpStorm 2023.3, it is now possible to set up color-coding for generics, making it easier to distinguish between generic types.
With the adoption of attributes increasing, it can sometimes be hard to read code that is annotated with long multiline attributes from a given framework. In PhpStorm 2023.3, this should no longer be an issue, since you can now fold multiline attributes.
PHPUnit 10 introduced support for attributes for adding metadata to test classes and test methods, as well as tested code units. We’ve implemented an inspection and a quick-fix that will help you migrate to this new style from the old PHPDoc annotations.
PhpStorm 2023.3 introduces a revamped way to review changes. Now, instead of going through each file one by one, you can see all of the modified files from a changeset in a single, scrollable frame. This new diff viewer is accessible from the Git Log tool window and currently works with JetBrains Space reviews. We’re working on making it compatible with GitLab and GitHub.
PhpStorm 2023.3’s new Run to Cursor inlay option allows you to quickly execute up to a specific line of code while debugging. Once your program is suspended, you can hover over the line of code you want to execute up to and use the Run to Cursor popup. The same can be achieved by invoking the keyboard shortcut Alt + F9 after placing the caret on the desired line.
In response to your feedback about the new UI, we’ve made it possible to hide the main toolbar when using the IDE’s default viewing mode, just like in the old UI. To remove the toolbar, select View | Appearance and uncheck the Toolbar option.
With the release of PhpStorm 2023.1, we introduced the ability to save multiple tool window layouts and switch between them, enhancing the customizability of your workspace. In PhpStorm 2023.3, we’re expanding this functionality by introducing the Default layout option, which provides a quick way to revert your workspace’s appearance to its default state. This layout is not customizable and can be accessed via Window | Layouts.
To make it easier to work with a variety of file types in the editor at the same time, we’ve introduced color-coding for editor tabs by default, mirroring their appearance in the Project tool window.
Packed with WebStorm features, PhpStorm now addresses some of the frustrating
inconsistencies that occur when adding import type
statements, and it makes
working with verbatimModuleSyntax
easier. We’ve added the option to
configure the kind of TypeScript import type statement. We’ve also improved
the behavior for the exports
field of package.json for TypeScript files.
Now, when you paste HTML code into a JSX file, not only will PhpStorm convert attributes, but it will also automatically close single tags for you. You can configure this option under Settings | Editor | General | Smart Keys | JavaScript.
@property
support
To support the new @property
API for creating custom CSS properties,
PhpStorm 2023.3 now offers inspections and completion features for explicitly defining
CSS custom properties, allowing you to check and restrict property types, establish
default values, and determine inheritance possibilities for custom properties.
We’ve added support for defineSlots
, providing completion and navigation
for the slot
name, as well as the Rename refactoring. We’ve also introduced
completion support for properties with defineExpose
. In PhpStorm 2023.3,
required imports for components will be added based on the name specified by the
defineOptions
function.