PhpStorm 2022.2 Early Access Program (EAP) is officially released! This release brings many new features with generics, Rector support and a host of quality improvements.
Rector Support
Rector , which automates PHP upgrades and code refactoring in batches, now has built-in support for it in PhpStorm.
To use PhpStorm's Rector support, you first need to install Rector and configure it . Next you should create a new run configuration specifically for Rector. PhpStorm can do this automatically: just right-click on the folder you want Rector to repair and select Run | Rector .
A new Rector configuration can also be created manually on the Edit Configuration screen.
Generics
Updated support for generics:
- Int<min, max>
int<min, max>
Types are now supported
- Generic support for iterables
PhpStorm is able to infer types when looping over iterables:
- Infer type from closure
PhpStorm is now able to infer generic types from closure return values.
- Support bypassing generic types
PhpStorm now handles methods better Collection::lazy()
where generic types are proxied into another object:
More about generics:
- Improved support for nested generics ( WI-66014 ).
- Flip generic types ( WI-66015 ).
- Support generics in iterators:
Iterator<Type>
( WI-62323 ). - Generics support in iterables:
iterable<KeyType, ValueType>
( WI-56037 ). @extends \SplFixedArray<Token>
Now works as expected (WI-65964) .- Improved generic type inference (WI-60891) .
other updates
- Added support for automatic insertion of arrows and commas in arrays.
- PhpStorm can be configured to automatically insert trailing commas in parameter lists, closure usage lists, and function calls.
- Supports and directives in blade components .
@props
@aware
- The PHP binaries to be used when running tools such as PHP CS Fixer or PHPUnit can be configured.
Read more in the release announcement .