PhpStorm 2022.2 EAP #2

Welcome back to the 2022.2 EAP series! If you’re new or unsure what our Early Access Program is, make sure to read the first post in this series. With that said, let’s take a look at what’s new in this week’s version!

Download PhpStorm 2022.2 EAP

New inspections

You can expect new inspections with every major PhpStorm release, and can already try a bunch out in this new EAP build:

Combining multiple isset() calls into one

Since PHP allows you to pass multiple arguments into one isset() call, it makes sense for PhpStorm to tell you about possible refactorings to clean up your code.

Use in_array() and array_key_exists() when possible

PhpStorm will be able to detect for loops that can be optimized to in_array() or array_key_exists() calls.

Add variable names to @var and @param docblocks when ambiguous

Sometimes PhpStorm can’t determine which variable a @var or @param docblock refers to, so we’ve added an inspection to make it easier for you to point to the right variable.

Convert array|Traversable to iterable

In PHP, the array|Traversable union is equal to the built-in iterable type. PhpStorm will now suggest replacing the former with the latter, resulting in cleaner code.

Convert <?php echo …; ?> to <?= and vice versa

PhpStorm now allows you to switch between <?php echo …; ?> and <?= within whole files with a single press of a button.

Replace simple preg_split() calls with explode

PhpStorm will now detect simple preg_split() calls and suggest using explode() instead.

Improvements to our debugger

Besides new inspections, we’ve also made some quality-of-life improvements to our debugger:

Put $this at the top if available during debugging

When debugging in the context of a class, $this will now always be on top:

Show concrete type and children of an array in the debug variables pane

The debugger’s variables pane now shows the contents of an array:

Display __toString() representation on an object

When an object implements the __toString() method, that textual representation will also be displayed in the variables pane:

Warn users when they open a file that should be associated with a plugin but it’s ignored or plain-text

Sometimes file types for specific files are configured to be ignored by PhpStorm, while users expect them to be properly detected. PhpStorm will now show a clear warning about opening such files, and will help you fix the configuration if needed.

Merging project windows on Mac

Windows on Mac supports a multi-tab view, and PhpStorm now allows you to merge all of your open project windows into this multi-tab view via Window | Merge All Project Windows:

The full list of changes in this build is available in the release notes.

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 problems you find to our issue tracker, or by commenting on this post.

Download PhpStorm 2022.2 EAP

Your PhpStorm team
The Drive to Develop

The PhpStorm Blog : The Lightning-Smart IDE for PHP Programming | The JetBrains Blog
Read More

Generated by Feedzy