JetBrains brengt verschillende ontwikkelomgevingen uit, zoals IntelliJ Idea gericht op Java, CLion gericht op C en C++ en DataGrip gericht op sql. PhpStorm is gericht op php en biedt on-the-fly-errorpreventie, autocompletion, coderefactoring en debugging, en kan ook overweg met html, css, Coffee- en JavaScript. Voor een overzicht van de mogelijkheden verwijzen we naar deze pagina. Voor het gebruik van PhpStorm is wel een licentie nodig. Voor zakelijk en thuisgebruik zul je daarvoor moeten betalen, maar als de software wordt gebruikt voor onderwijs of niet-commerciële opensourceprojecten, is de licentie gratis. JetBrains heeft kort geleden versie 2022.1 van PhpStorm uitgebracht en de belangrijkste veranderingen en verbeteringen die daarin zijn aangebracht kunnen hieronder worden gevonden:
Multiline and nested array shapesArray shape support in PHPDoc blocks have been supported since PhpStorm 2021.2. However, only single-line and single-level annotations were supported. In PhpStorm 2022.1, we’ve added full support for multiline and nested array shapes in both PHPDoc and in #[ArrayShape] attribute!
Add array shape annotations to get the code completion for the keys and infer the value types in simple array data structures or object-like arrays. You can use both PHPDoc and Attribute syntax in PhpStorm, whichever you prefer. The syntax is supported for return types and parameter types. Learn more
Inplace Extract Method refactoringExtract Method is one of the most used refactorings in PhpStorm. In order to simplify code and create a new method, just select the piece of code and press
⌘
+⌥
+M
(Cmd
+Alt
+M
/Ctrl
+Alt
+M
).Previously, this would open a dialog for the refactoring configuration. No one likes pop-ups though, so now, in many cases, for extracting a method you can use the inplace refactoring instead. There will be no dialog, and a new method (or function) will be created right away in the editor. The cursor will be active to edit the name of the new method. Learn more
Enhanced support for Laravel Blade templatesPreviously, PhpStorm treated every code block in Blade templates as an independent scope. This often caused issues with code completions and insights. In PhpStorm 2022.1, we significantly reworked how the IDE handles Blade templates. As a result, you’ll get way better code completion in your
Improvements for WordPress Support for dynamic paths with `get_template_directory_uri()`.blade.php
files. Many more issues with code completion and formatting in Blade templates were resolved as well. Learn more.In PhpStorm, you can
Jump from hook invocation to registrations⌘
+Click (Ctrl
+Click) on file paths to open the corresponding files in the editor. That didn’t work for dynamic paths in WordPress code when the path was compounded with WordPress functions. In this release, we are adding support for theget_template_directory_uri()
function in paths. More functions to be supported in the next updates.The WordPress hook system is powerful, but it was not possible to jump from where a hook was called to where the handler is declared. Now there is a gutter icon to the left of an invocation. Click it to see the list of hook usages, including registration and other invocations.
New advanced PHP metadata capabilitiesAs you may know, besides having built-in “code awareness” capabilities, PhpStorm also has external knowledge of code. This knowledge comes in the form the .phpstorm.meta.php file. You can use it to teach PhpStorm more information about the codebase, resulting in improved completion.
Support to magic __call and __callStaticIf you rely on the magic methods
Support union types_call
or_callStatic
, then you would lose code completion for the methods, as they are not defined. In this release, you can add the corresponding metadata entry and get autocompletion for such calls. You can even automatically handle dynamic calls, receiving a specific method name from a parameter value.You can now specify union types as
Improved annotations support and generics@|MyClass
in .phpstorm.meta.php – this can improve the coding assistance for mocks. Learn more about other metadata features in the documentation.We continue to improve our support for annotation-based generics in PhpStorm. In this release, we covered a few more cases, including, but not limited to:
New Composer Project wizard
@psalm-import-type
,@phpstan-import-type
@psalm-trace
,@phpstan-trace
- Generics in
@method
tagsIn PhpStorm 2022.1, when creating a new empty project, you have the option to automatically generate a
User Experience b New Notifications tool windowcomposer.json
file for it and provide the desired dependencies. After the project is created, PhpStorm will prompt you to install them.We replaced the Event Log instanсe with a new Notifications tool window. It helps you maintain a better overview of the IDE notifications and reduces the chance of missing anything important. By default, the new tool window is located in the bottom-right corner of the IDE window. All notifications come in two categories: Suggestions and Timeline.
Updated Structural Search and Replace dialogInvoke Structural Search and Replace from the main menu Edit | Find | Search Structurally… We’ve redesigned the Structural Search and Replace dialog to feature a list of all the templates to make it easier to navigate through them. We’ve also added a Pin Dialog icon in the upper right corner of the Structural Search and Replace dialog.
Evenly split tabsYou can now evenly distribute the working space among editor tabs to have the same width. Enable Settings / Preferences | Advanced Settings | Editor Tabs | Equalize proportions in nested splits.
Export UML diagram to other formatsIt is now possible to export UML diagrams as yEd .graphml, JGraph .drawio, Graphviz .dot, Mermaid .md, Plantuml, and IntelliJ IDEA .uml files, which makes them compatible with third-party tools.
Improvements for Markdown Run commands from Markdown filesREADME files often describe the steps needed for running an app and list the commands you need to use. PhpStorm 2022.1 will let you run those commands right from the markdown file – just click on the Run icon in the gutter to the left of the command.
Copy code snippet for MarkdownWe’ve also added a new Copy code snippet action to Markdown blocks, which will let you quickly copy their contents to the clipboard.
Updated Markdown Editor Floating ToolbarWe’ve reworked the floating toolbar that appears on text selection, to make it easier to format Markdown files. In addition to the new design, the toolbar now lets you create lists and provides a menu for selecting header styles. The toolbar is customizable, so you can fill it with the options you need most. Go to Settings / Preferences | Appearance & Behavior | Menus and Toolbars | Markdown Editor Floating Toolbar.
VCS Updated Annotate with Git BlameWe’ve improved the functionality of Annotate with Git Blame to make investigating introduced changes easier. The IDE highlights the difference in the lines right in the editor when you hover on an annotation and opens the Git Log tool window when you click on it.
Suggested changes in pull request commentsIt’s now easier to work with suggested changes in PhpStorm as you can now apply or commit changes locally, right in the IDE.
Updated Commit Details pane in Git tool windowThe Commit Details pane now includes information about GPG signatures and build status. Previously, this data was shown only as a column in the Git log.
Git File History: new UI without indexThe new UI for the Git File History tool window is now independent of the indexing process. The data is represented with a new interface even if the Log index is off.