PhpStorm 2022.2 EAP #6: Mockery Support, Enhanced Inspections Configuration
Welcome back to the 2022.2 EAP series! If you’re unsure about what our Early Access Program is, make sure to read this blog post. Let’s take a look at what’s new in this week’s EAP build.
We’ve been working on implementing support in PhpStorm for Mockery, one of the most popular mocking frameworks for unit testing in PHP. We’ve added support for autocompletion and code insights in many places, as well as some useful inspections.
Autocompletion for mocks
First things first: Proper autocompletion is now available for mocked objects. Both the mocked object’s methods and properties are available in the autocompletion menu, along with the functionality that Mockery provides through its mock objects.
Support for class names as strings
It’s also possible to pass in class names by string in the
mock() function. PhpStorm will suggest the right class name for you, autocomplete it, and offer the same insights into the mock object that you would see if you used the real class name.
Support for mocking protected methods
PhpStorm will detect when you’re trying to use a protected method and will offer to add
shouldAllowMockingProtectedMethods() for you.
PhpStorm will properly detect mocked interfaces for a given class and will be able to make suggestions based on the interface’s definition.
Partial mock support
Insights into mock objects will work even for partial mocks.
Note that our work to add support for Mockery’s partial mock declaration syntax is still in progress: https://youtrack.jetbrains.com/issue/WI-66927.
Run Current File
With 2022.2, we’re introducing an improved version of the Run Current File functionality that is available from the Run/Debug widget. The widget now features a secondary menu that offers applicable runners along with the Run with Parameters action, which lets you tune the run configuration parameters before running the file.
Enhanced configuration for highlighting inspections
We’ve improved the way you configure your preferences for highlighting inspections. When you want to change how an inspection appears in the editor, you can configure this using the new Highlighting in editor drop-down menu, which conveniently shows all available highlighting styles.
Bundled VSCode keymap plugin
The VSCode keymap plugin is now bundled by default, meaning you no longer need to manually install it.
Type narrowing support for Vue
We continue to make working with Vue 3 better for you. We’ve added initial support for type narrowing, and PhpStorm now supports union types and understands
We plan to roll out more fixes related to type narrowing in the near future. Stay tuned!
Support for Angular standalone components
We’ve been actively working on supporting Angular 14 in PhpStorm. The most important addition we’ve made in this release is support for Angular standalone components. Standalone components offer a simplified way to build Angular applications. Components, directives, and pipes can now be marked as
standalone: true. Angular classes marked as standalone do not need to be declared in an
The full list of changes in this build is available in the release notes.
- 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, but expire 30 days after the build date.
Please report any problems you find by posting them to our issue tracker or by commenting on this post.
Your PhpStorm team
The Drive to Develop
Subscribe to Blog updates
Thanks, we've got you!