Early Access Program

PhpStorm 2021.1 EAP #2

Last week we launched the Early Access Program for PhpStorm 2021.1. We are going to be releasing weekly updates for the next two months, and today we’ve got the second build of the 2021.1 EAP for you.

What’s new in this EAP build:

  • PHP settings now at the top level
  • New quick-fix: Invert `if` statement
  • Highlighting unsafe http:// links
  • Maximize editor tabs in the split view
  • Fixed debugging WSL2 project with Docker

Download PhpStorm 2021.1 EAP

  • Important! 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 and don’t require a license. But they expire 30 days after the build date, and you’ll have to download a new build.

PHP settings now at the top level

Previously, the main PHP-related settings were stored under Preferences | Languages & Frameworks | PHP.

To make it easier to find and change them, we’ve moved this section to the top level Preferences | PHP.

New quick-fix: Invert `if` statement

Press Alt-Enter on any ‘if’ and choose “Invert ‘if’ statement” from the menu. This will change the condition to the opposite and make the necessary code adjustments to preserve the logic.

If you are a fan of the ‘early return’ practice, this action will be very handy as it helps you refactor your code.

Check this example:

It will also work in cycles and helps you simplify them:

Language injected in assigned values based on variable usage

In previous versions, PhpStorm detected the language for arguments. For example, if you passed a pattern string to preg_* functions, it was highlighted as a regular expression.
But if you wanted to pass a variable, the value of the variable would not be highlighted.
PhpStorm 2021.1 will analyze how variables are used and inject language reference automatically.

A new inspection highlights http:// protocol usages in strings and offers an Alt-Enter quick-fix to change them to https://.

You can also add URLs to the ignore list, or disable the inspection with a quick-fix.

The list of all ignored URLs and other settings for this inspection (for the whole project or parts of it) is available under Preferences/Settings | Editor | Inspections | SecurityLink with unencrypted protocol.

Maximize editor tabs in the split view

You can split the editor by dragging a tab to the corners of the IDE window.
In 2021.1, you can double-click the tab you’re working with to maximize the editor area for it. To bring that tab back to its original size, simply double-click it again.

Notable bugs fixed:

  • Debugging WSL2 projects with Docker (WI-53396 +86).
  • Quality tools now resolve paths properly with docker-compose in exec mode (WI-55840 +30).
  • Correct <?php opening tag parsing near comments (WI-10799 +10).

The full list of changes in the EAP #2 build is available in the release notes.

Please let us know about any problems you find by reporting them to our issue tracker or commenting on this post.

Your JetBrains PhpStorm team
The Drive to Develop

image description