Improved complete statement support in arrays We’d like to keep improving our generics support, so don’t hesitate to submit an issue when you run into cases that aren’t supported yet. Improved generic type inference (WI-60891).SplFixedArray now works as expected (WI-65964).Support for generics in iterable: iterable now works as expected ( WI-56037).Support for generics in iterators: Iterator now works as expected ( WI-62323).Improved support for nested generics ( WI-66014).PhpStorm now handles methods like Collection::lazy() better, where generic types are proxied into another object: You can now use generics in combination with traits by using the annotation: Support for by-passing generic types This feature is used a lot in, for example, Laravel collections where you pass a closure to a collection function like map or first: Generics in traits PhpStorm is now able to infer generic types from closure return values. PhpStorm will now also be able to infer types when looping over iterables: Infer types from closures For example, we now support the int type: Generic support for iterables This EAP comes with a lot more improvements to generics. Let’s take a look at what we’ve done with our generics support. With this EAP release, we’re happy to say we’ve made significant progress. When we announced basic support for generics in PhpStorm back in 2021, we knew there was plenty more work to be done in the future. Either go to Run | Edit Configurations or choose Edit Configurations from the search actions menu:Īlternatively, you can manually create new Rector configurations on the Edit Configuration screen as well. Since Rector is a run configuration, you have the option to configure it, as well. You can then review changes in PhpStorm, select individual files and folders, and finally apply all selected changes. PhpStorm can do this automatically for you: simply right-click the folder you want Rector to fix and then select Run | Rector:Īs you can see, PhpStorm will give you a list of files that Rector will change. Next, you should create a new run configuration specifically for Rector. In order to use PhpStorm’s Rector support, you first need to install Rector and configure it. It’s an amazing tool, and we’re happy to provide built-in support in PhpStorm for it. Rector helps you with automatic PHP upgrades and code refactorings in bulk. With that said, let’s take a look at what’s new in the first EAP release of PhpStorm 2022.2! Rector support
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |