PhpStorm 2022.1 EAP #3: Enhanced Array Shapes
The third build of our Early Access Program for PhpStorm 2022.1 is now available!
This blog post will cover enhanced support for array shape annotations that improve code completion for object-like arrays.
The Toolbox App is the easiest way to get the EAP builds and keep your stable and EAP versions up to date. You can also manually download the EAP builds from our website.
Multiline and nested array shapes
In PhpStorm 2021.2, we introduced support for array shapes in PHPDoc blocks. It came with a significant limitation, though – only single-line and single-level annotations were supported.
To get multiline support, you had the option of using the
#[ArrayShape] attribute. However, this still had no support for nested structures.
In PhpStorm 2022.1, we are adding full support for multiline and nested array shapes in both PHPDoc and attributes!
While PHP has a great object system, there could be times when defining a real class feels excessive and it’s more convenient to work with simple data structures or object-like arrays.
In such cases, define the structure of arrays with array shape annotations to get the code completion for the keys and infer the value types.
You can use booth PHPDoc and Attribute syntax in PhpStorm, whichever you prefer. The syntax is supported for return types and parameters type definitions. See the PHPDoc example above and here is an attribute one:
Along with the multiline and nested annotations support, there are many additional improvements for array shapes.
Support array shapes with numeric keys
Support specific arrays in object-like arrays
Support lists in array shapes
@var array shape annotations of variable usages
Improvements to Vue
PhpStorm incorporates all the improvements for HTML/CSS/JS and other web technologies from WebStorm.
So the 2022.1 version of JetBrains’ IDE comes with several improvements to Vue 3. In this version, if you define components as global, the IDE will recognize them in your .vue files. PhpStorm will also properly support the createApp syntax. It will correctly match applications created using createApp with their related elements.
This version also includes support for Nuxt 3, a new version of the popular Vue framework.
The full list of changes, including bug fixes and improvements, is available in the release notes.
Join the Early Access Program
EAP is a great opportunity to provide feedback on the upcoming features and help us shape the future of the IDE.
You can download the latest EAP build from our website or via the Toolbox app.
- PhpStorm EAP builds are not fully tested and may be unstable.
- You can install an EAP build side by side with a stable PhpStorm version to try out the latest features.
- EAP builds are free to use but expire 30 days after the build date.
Please report any issues you come across to our issue tracker, or mention them in the comment section of this post.
Tweet at us @phpstorm!
Your JetBrains PhpStorm team
The Drive to Develop
Subscribe to Blog updates
Thanks, we've got you!