JetBrains | Newly Released PhpStorm 2020.1
What’s New with Version 2020.1?
Out-of-the-box composer.json support
Manage dependencies with ease: all the actions are now available right in the editor of a composer.json file.
We’ve deprecated the old Manage dependencies dialog because working with the packages from inside the composer.json file is a lot easier.
To add a new package, you can start typing its name in the require(-dev) section, or press [⌘+Space], and choose the one you need from the suggestion list.
All the available versions of the specific package will be listed, too.
Creating new composer.json file
When you start a new project, you can create a composer.json file using the template in the IDE. Right-click in the project tree and select New -> composer.json File.
Updating and installing packages
If there’s a dependency that is specified in composer.json but has not yet been installed, PhpStorm will detect and highlight it.
Install it by pressing ⌥+Enter and choosing Update package or Update all packages..
Navigating to files and folders
You can use ⌘+Click on a package to have PhpStorm highlight the folder of that package under the vendor directory in the Project Tree. For files, this will open them in the editor.
The same ⌘+Click, or ⌘+B, trick works to open any link in composer.json in a browser..
Composing and running scripts
Each entry in the scripts section has a play icon in the gutter that you can click to instantly run the script.
When adding a new script entry, autocompletion now supports script references, binary files from the vendor/bin directory, and any PHP files from your project source.
Code coverage with PCOV and PHPDBG
In addition to Xdebug, it is now possible to use either a lightweight PHP extension krakjoe/pcov or the built-in PHPDBG to generate coverage reports much faster.
You can create a Run configuration for tests. In the Run configurations settings, there is a dropdown to choose your preferred coverage driver: Xdebug, PCOV, or PHPDBG.
Select your preferred driver, click the Run with Coverage button in the main toolbar, and observe the coverage results.
PhpStorm 2020.1 has tools to help you upgrade to the latest PHPUnit version quickly and easily.
Every deprecation will be highlighted in the editor. Put the cursor over a deprecated item and press ⌥+Enter, then select your preferred quick-fix from the list that appears. Or just choose it at the bottom of the error description window.
To quickly create a new PHPUnit test class, you can now use the Create new PHP Test intention by pressing ⌥+Enter on a class name.
PHP type inference improvements
The core of PhpStorm – the type inference engine – has received a few nice improvements.
Detecting redundant @var tag
If the @var tag with type info is redundant and PhpStorm already knows the correct type of the variable, then this tag will be highlighted. You can delete it with the Remove @var quick-fix by pressing ⌥+Enter.
Better tracking of null
Tracking nullability is a tough task, and there used to be some places where PhpStorm was unable to detect it. This is no longer the case for the 2020.1 version. PhpStorm lets you know whether a variable is null or not and helps you avoid nullability problems.
Completion in array_map/filter
There is now a full completion option for parameter variables inside of the closures that are passed to array_map() and array_filter() functions.
Infer a non-generic array type from an initializer
If you’re iterating over an array with a known set of items, you no longer need an additional @var tag to specify the type, as PhpStorm will propagate it automatically.
LOGON is a pan-asian company operating in China, Hong Kong (HK), India, Singapore, Malaysia, Indonesia, Vietnam, Philippines and Thailand. LOGON has local dedicated trained product specialists in Hong Kong, Guangzhou, Kuala Lumpur, Mumbai and Bangalore. LOGON acts both as value added reseller and sole distributor for award winning software solutions. Customers can buy new licenses, purchase upgrades and renewals from any of our local offices. Contact us for first line support during evaluations, PoCs. We offer best practices consulting services and classroom & online training. Check our site for latest offers, special discounts, bundle deals, etc..