What’s New in PhpStorm 2019.2

Experience hyper-productivity with the second major PhpStorm update of 2019.

PHP 7.4 Typed Properties

The release of PHP 7.4 is expected at the end of November. PhpStorm is starting to roll out support for it early, so that you have time to test and start planning the migration. The most anticipated feature is probably the new Typed Properties, which PhpStorm 2019.2 already fully supports. New inspections will highlight the type violations, and you can update your codebase using the quick-fix Add declared type for the field. PhpStorm will detect the type automatically based on the PHPDoc, default value, or argument type declaration in a constructor.

Locate Duplicates on the fly

Having the same code block appear several times in your project can cost you time making changes, or even cause regression bugs if you ever forget to update all the occurrences. PhpStorm helps prevent the creation of code duplicates in your code by highlighting them on the fly so you can easily spot them. Now, if you stumble across an existing duplicate, or somehow create one in your code, you will know it instantly! The new inspection is called Duplicated code fragment and is enabled by default. To configure it, go to Preferences | Editor | Inspections | General. You can adjust the relevant settings under Preferences | Editor | Duplicates. And, of course, you can run it on the entire project (or custom scope) anytime via Code → Run Inspection by Name.

Regular Expressions highlighting and check

RegExps are an extremely useful tool for searching and replacing in strings. Now in PhpStorm, you get automatic injections for RegExps in PHP. This means that whenever your code uses preg_* functions, the pattern will be highlighted and verified for correctness. Moreover, you can now test your patterns right in the IDE! Move the caret over the pattern and press Alt+Enter to see the quick action Check RegExp.

Run Composer via any remote PHP interpreter

Previously you had to have a local PHP interpreter to run Composer. The problem with that was the local environment often didn’t reflect the real production setup or there might not even be a local PHP interpreter at all. In PhpStorm 2019.2, you can choose any remote interpreter to run your Composer with: Docker, Vagrant, via SSH, or anything else – you name it!

Go to Preferences | Languages & Frameworks | PHP | Composer, select Remote Interpreter, and choose an interpreter from the dropdown – or add a new one.

Intentions & Quick-Fixes

New Intentions in String Juggling Toolbox

New Intentions in String Juggling Toolbox

PhpStorm comes with multiple intentions Alt+Enter to manipulate strings. There’s a new one for 2019.2.

If you need to introduce a new parameter in a sprintf expression, simply select it, run the Extract selected string part as format function argument intention, and PhpStorm will choose the correct place for a parameter for you. This works for concatenation as well.

Сonvert a single line list to multi-line, and back

Сonvert a single line list to multi-line, and back

According to PSR-2, lines longer than 80 characters should be split into multiple subsequent lines of no more than 80 characters each. So if your parameters list or array has become too long, you can now split it with one-click using the new intention Alt+Enter Split comma-separated values into multiple lines. The reversed intention is also available for cases where you want to combine items into one line.

Intention and inspections for Switch statements

Intention and inspections for Switch statements

It is now possible to add branches faster by copying existing ones and then modify them. You can use Alt+Enter on the body-less case statement and choose Copy ‘switch’ branch. Don’t forget to modify the copied one, because PhpStorm will warn you if a switch block has a duplicated branch, i.e. the same body, which can either be redundant or written by mistake. Also, in PhpStorm 2019.2 if you have a switch statement without a default branch in your code, you can quick-fix this with Alt+Enter too.

PHPT support

The .phpt files can help you write functional tests in a simple way. This format is used to test the PHP core. PhpStorm 2019.2 comes with support for .phpt files, including highlighting for sections and scripts, PHP and INI languages auto-injection to corresponding sections, completion of section names, and jumping to files referenced in EXTERNAL sections.

Docker

Services Tool Window

Services Tool Window

Docker has been moved to the new Services tool window. The goal of this tool window is to provide a single location to view all the connections and running processes. So far in PhpStorm, it includes Docker and Database connections.

Browse Docker container file system

Browse Docker container file system

It is now possible to view the file system of the running Docker container. The file system is displayed in the newly added Files tab.

HTTP Client

cURL format in the HTTP client

cURL format in the HTTP client

Simple as it is, copy the cURL request string from your browser dev tools, documentation, terminal, or anywhere else, and then just paste it to .http file in PhpStorm and see it expanded to a full request! After that go ahead and play around with your request with the power of smart completion.

Preserving cookies in the HTTP client

Preserving cookies in the HTTP client

Let’s say you’ve made a request to authenticate on the service and in subsequent requests you would like to call some endpoints that require additional permissions. Previously, you would lose the cookies from the first response. But not anymore: PhpStorm now keeps all the cookies for you and transfers them in the next requests.

Web Technologies

As usual, all the features and improvements of WebStorm are available in PhpStorm, either out of the box or with free plugins available from the plugin repository.

Smart intentions for JavaScript and TypeScript

Smart intentions for JavaScript and TypeScript

With the new Propagate to destructuring intention Alt+Enter, you can replace an extra variable with another destructuring. To remove a destructuring completely, use the intention action called Replace destructuring with property or index access.

The IDE will now warn you if a boolean expression in a condition has any unnecessary parts and will suggest simplifying it.

Improved Rename refactoring for JavaScript

Improved Rename refactoring for JavaScript

When you rename a symbol in a JavaScript or TypeScript file, the IDE now groups together dynamic usages and, by default, excludes them from the refactoring. This makes the refactoring more accurate and gives you more control over what exactly should be renamed in the Refactoring Preview tool window.

Better support for Vue.js

Better support for Vue.js

Are you using Vuetify or BootstrapVue in your Vue.js application? Code completion for components and their props from these and other Vue component libraries is now more precise. This was made possible by a new approach we’ve adopted to working with these libraries in the IDE.

Syntax highlighting for over 20 languages

Syntax highlighting 20+ languages

PhpStorm 2019.2 provides out-of-the-box syntax highlighting for over 20 different programming languages including Ruby, Python, Go, and others. The highlighting is based on integrated TextMate bundles, so if you need any additional language, feel free to download the corresponding bundle for this language and import it into the IDE.

EditorConfig

EditorConfig

PhpStorm now supports .editorconfig files out of the box! You can have as many of them as you wish. Create them in any folder and the specified code style settings will be applied to the files in that folder only.

In addition to all the standard properties of the EditorConfig standard, you can now also specify PhpStorm-specific code style options. It’s never been easier to define common code-style standards for the whole team.

Shell Scripts

Shell Script support

This release offers rich editing support for shell scripts, including word and path completion, Quick documentation, and even the Rename refactoring. You can also create run configurations for executing shell scripts.

We’ve integrated PhpStorm with several external tools for even more advanced shell script support. From now on, you can use Shellcheck to detect and fix errors in your script, mvdan/sh to properly format your shell script, and Explainshell to get a full description of a command by pressing Alt+Enter.

Version Control

Ignore file handling out of the box

You can now add files to the list of ignored files from either the Project Tree or the Local Changes tab of the VCS tool window. If you prefer editing .gitignore, you can use path completion in the editor.

New commit flow without a dialog

PhpStorm 2019.2 brings a big change for projects that use Git or Mercurial. Now you can commit files from the Local Changes tab of the Version Control tool window. There, you can review the modified files and make changes if necessary because the commit dialog doesn’t block the rest of the IDE. To give it a go, select the “Commit from the Local Changes without showing a dialog” checkbox in Preferences | Version Control | Commit Dialog.

Remind about forgotten files

Remind about forgotten files

If you are committing some files and PhpStorm 2019.2 detects that there are other files changed that you often commit together with the currently committed ones, then the IDE will warn you about it so you don’t miss anything.

Customize VCS Log tab

Customize VCS Log tab

Now you can choose which columns you want to see in the Log tab of the Version Control tool window. Click the eye icon, select ‘Show Columns’, and then select the columns you want to display: author, date, or commit hash.

Database Tools

Full-text Search offers comprehensive results

Full-text Search offers comprehensive results

Now you can search for the necessary data even if you don’t know its exact location. Right-click the data source or a group of data sources that you want to search through, and select Full-text Search, or pressCmd+Alt+Shift+F.

The results are filtered to show you only those strings in which the data is found. If you cannot locate the data because there are too many columns, use the text search in the data editor: Cmd+F.

Filtering by a data source available in search and navigation

Filtering by a data source available in search and navigation

Locating an object in the GoTo popup is not easy sometimes, because often there are too many similar items. In PhpStorm 2019.2, you can choose where to search: in a particular data source or in a group of sources. The same works for Find In Path. This is extremely useful if you are looking for source code inside of DDLs of other objects.

Learn about PhpStorm 2019.1

Debug Twig and Blade Templates

Debugging is very effective when you face a nasty bug or dive deep into a codebase. But it's a nightmare to go through the machine-generated code of compiled templates. With PhpStorm and Xdebug, you can now do step-debugging in original uncompiled .twig and .blade.php files of these two popular template engines. All debugging benefits are available here: see the context, local and global variables, add watches, run step-by-step, and more!

Locate Dead Code

If you’re dealing with a legacy codebase and want to clean up things, a good way to start is removing dead code. Now PhpStorm detects redundant code and highlights classes, class members, and functions that are probably never used. The Unused declaration inspection takes into account dynamic usages of the code, for example via magic methods. To check the report for the whole project, select Code -> Inspect Code….

Refactorings, Intentions & Quick-Fixes

String Concat To Strintf

String Juggling Toolbox

We’ve added multiple new intentions for manipulating strings. You can now convert string concatenation to interpolation, convert a concatenation or interpolation to a sprintf call, copy a concatenated string to the clipboard, and do many other things. Press Alt+Enter on a string to see the available actions.

VCS Improvements

Remove Unused Variable

PhpStorm 2019.1 introduces a new quick-fix that helps you get rid of the unused variables that appear in assignments’ or closures’ use lists. The quick-fix is smart enough to detect situations when the assignment expression may have side effects.

Move To Class Refactoring

Move To Class Refactoring

With the new Move to Class refactoring, you can transit functions or constants to the Class they logically belong to, and PhpStorm will find and modify all usages for you. You can move multiple functions simultaneously by selecting them in Structure tool window.

Method May Be ‘static’ Inspection

Method May Be ‘static’ Inspection

If a class has a method that doesn't use any instance references, PhpStorm will detect it and offer a handy quick-fix: press Alt+Enter on the method, and make it static. All the usages will be updated automatically.

Docker

Reuse Containers

Docker Reuse Containers

For interpreters based on Docker Compose, you can now choose between docker-compose run or docker-compose exec for executing containers. If you have a heavy container that you don’t want to restart on each test run, you may reuse it by choosing the docker-compose exec option. Or you can use docker-compose run for lightweight containers or those not working in daemon mode (that is, stopping right after they start).

PHP

Improved Autocompletion

With the help of a special file, .phpstorm.meta.php, PhpStorm is now able to suggest arguments and return values better. This is to cover situations when, instead of some simple type like integer or string, you would like to see a certain set of constants suggested. Or if you expect some function to return a certain constant. You can also improve suggestions in PhpStorm for your library or project by providing your own .phpstorm.meta.php file.

Reworked Imports

Improved Imports

We’ve reworked the inspections and intention actions related to namespaces importing and using FQN. The main idea behind them is to avoid qualifiers as much as possible. Now, PhpStorm will let you simply remove a redundant qualifier if possible, or replace it with the corresponding ‘use’ import statement. Also, when you paste some code into a file, PhpStorm will ask to reuse an existing alias.

Code Cleanup

In PhpStorm 2019.1, the Code Cleanup tool comes with PHP-specific intentions: it can optimize full class name occurrences by either adding the ‘use’ statement or removing the unnecessary part from it. It can also automatically fix code style issues with PHP CS Fixer or PHP_CodeSniffer’s phpcbf. Execute a cleanup before VCS commit, or trigger it manually at any time via Code -> Code Cleanup…..

Web Technologies

As usual, all the features and improvements of WebStorm are available in PhpStorm, either out of the box or with free plugins available in the repository.

Updated docs and browser compatibility

Updated docs and browser compatibility

The documentation (F1) for CSS properties and HTML tags and attributes now shows up-to-date descriptions and information about the browser support from MDN as well as links to the full MDN articles. Also, to check that all the CSS properties you use are supported in the target browser version, you can enable a new Browser compatibility inspection in preferences.

Improved support for TypeScript in Vue apps

Improved support for TypeScript in Vue apps

PhpStorm now leverages the TypeScript language service together with its own TypeScript support for TypeScript code in .vue files. This means you’ll now get more accurate type checking and type info, be able to use the quick-fixes provided by the service, and see all the TypeScript errors in the current file in the TypeScript tool window.

New inspections for Angular apps

For Angular applications, PhpStorm adds 17 new inspections that will help you detect Angular-specific errors in your app as you type, and will suggest appropriate quick-fixes. Working both in the TypeScript and template files, these inspections will check your use of bindings, directives, components, and many other things.

New debugger console

Meet the new, improved interactive debugger console in the JavaScript and Node.js debug tool windows! It now displays objects using a tree view, and it supports styling of log messages with CSS and grouping them using console.group() and console.groupEnd(). You can also filter out any type of log messages.

Convert function with Promise to async/await

You can automatically change a function that returns a Promise with .then() and .catch() calls to an async function that uses the async/await syntax. Simply press Alt-Enter on the name of the function and select Convert to async function. This is possible not only in TypeScript files, but also in JavaScript and Flow.

IDE

Recent Locations

Recent Locations Popup

In this new navigation popup, you’ll find recently visited code points presented with a context – a couple of lines before and a couple of lines after. All the locations are chronologically ordered in this popup, with the last visited location at the top. To call up the new Recent Locations popup, press Cmd-Shift-E / Ctrl+Shift+E. Type in any text to search within the context.

VCS Improvements

VCS Improvements

A new ‘Uncheck all’ checkbox for partial Git commits lets you uncheck all the code chunks at once, and then choose the ones you want to commit. In addition, fixup, squash, and cherry-pick actions are now available right in the Git log.

Improvements in Database tools

Custom UI Themes

If the default white and Darcula themes are not enough for you, try Dark Purple or create a custom one! The color of any element of your IDE, from icons to radio buttons to arrows, is now configurable. Fine-tune everything to your liking and save it as a new theme plugin!

Database Tools

The database tools in PhpStorm have got some cool improvements thanks to our colleagues on the DataGrip team:

  • Support for new databases: Greenplum, Vertica, and Apache Hive
  • Code completion supports combined statements for CREATE and DROP
  • Support for DEFINER attributes in MySQL and MariaDB
  • Support for the Oracle mode in MariaDB
  • You can now set the default folder for a project

Other Improvements:

  • New coloring options for primitive parameter types and class members by visibility. You can configure the color scheme in Preferences | Editor | Color Scheme | PHP.
  • You can now enable soft-wraps in the editor for specific file types. To do this, open Preferences/Settings | Editor | General and specify the file types in the ‘Soft-wrap files’ field.
  • PHPDoc styling configuration is improved: sort use statements, define the order of tags, and customize the number of spaces. To find all the options, go to Preferences | Editor | Code Style | PHP and look for the PHPDoc tab.
Learn about PhpStorm 2018.3

PHP

Doctrine Query Language

Doctrine Query Language

One of Doctrine ORM's key features is the ability to write database queries in DQL, which is a query language for your object model. It means that in your queries, you’ll be using PHP classes’ and fields’ names to fetch or update data. PhpStorm comes with full advanced DQL support. You’ll get all the inspections and refactorings: find usages, rename entity or field, associations support, and even more.

PHP 7.3 Support

PHP 7.3 Support

The latest PHP interpreter update brings with it a lot of new features for the community. PhpStorm supports all of them, including flexible Heredoc and Nowdoc syntax, trailing comma in function and method calls, literals as the first operand of instanceof, and the list() reference assignment.

Ctrl+Dot Completion

Press Ctrl+. in the suggestions list to get the completed item followed by an arrow. You can then type in the method name right away.

PHPDoc Improvements

PhpStorm adds Support for Intersection Types “&. If you annotate a variable as Foo&Bar, then it is of type Foo and of type Bar at the same time. PhpStorm will also suggest members of both classes.

Improvements for formatted string functions

PhpStorm makes it easier to use printf() / sprintf() and prevent common mistakes.

Refactorings and Intentions
Refactorings and Intentions

Refactorings and Intentions

PhpStorm 2018.3 delivers many refactoring improvements and related intention actions:

  • With the Replace with Alias intention, you can now replace use Foo\Bar with use Foo\Bar as Baz, which will also replace all Bar occurrences with Baz. The opposite action Inline Alias is available as well.
  • The new intention Сhange Class Member Visibility allows you to safely switch public/protected/private modifiers of properties and methods.
  • Private name refactoring is improved and by default PhpStorm will search only context usages when renaming private properties.

Deployment

Remote Deployment To Multiple Hosts

Remote Deployment To Multiple Hosts

PhpStorm lets you copy files and folders to a remote server using FTP/SFTP/FTPS, as well as to a local or mounted folder as a destination. Now you can deploy to multiple servers at once by using server groups. Add as many groups as you wish with an arbitrary number of destinations in each group, and deploy to all servers in a group simultaneously in one click.

Quality Tools

PHP CS Fixer Support

PHP CS Fixer Support

Now with PHP CS Fixer support, it becomes possible to automatically fix code style issues. Not only will PhpStorm detect the path to PHP CS Fixer for you, but it will also autodetect your custom ruleset and turn on the corresponding inspection. Go to some file with code style issues, and run quick-fix that will update the whole file at once.

Autodetect non-PSR coding standards for PHP_CodeSniffer

Non-PSR coding standards for PHP_CodeSniffer will be autodetected from your composer.json for the following frameworks: Symfony, Doctrine, Drupal, WordPress, Joomla!, Magento, MediaWiki, Yii 2, and CakePHP.

Simplified settings of quality tools

The quality tools settings have been simplified: you can now configure all supported tools (PHPCS, PHPMD, and PHP CS Fixer) in one place.

Version Control

GitHub Pull Requests

GitHub Pull Requests

You can now work with pull requests inside PhpStorm. Select VCS | Git | View Pull Requests in the menu to open a new tool window with a list of all the pull requests in your project. You can see the description, assignee, reviewers, labels, and changed files from the pull request. See diffs and create a new local branch from pull requests right there.

Support for Git submodules

All the familiar features in the Git integration, such as update project, commit changes, view diff, and conflict resolution, now work with Git submodules.

Ignore whitespaces

You can now ignore or trim whitespaces while merging – the configuration is available in the new drop-down at the top of the Merge Revisions for… dialog. Whitespaces are also ignored by default when you use Annotate for a file.

And even more

Advanced navigation in the VCS log with arrow keys, a parallel fetch of multiple Git repos, better support for pre-commit hooks, and a lot of other improvements are in store.

Web Technologies Support

Autoimports in JavaScript

Autoimports in JavaScript

In JavaScript files, PhpStorm can now automatically add imports not only for symbols defined in your project, but also for symbols from the project’s dependencies. This works as long as the library has sources written as ES modules or a TypeScript type definition file.

Improved Angular support

Improved Angular support

PhpStorm is now much better at helping you edit Angular templates. Сode completion and Go to definition for variables, pipes and async pipes, as well as for the template reference variables, are now much more accurate. In total, over 50 known issues have been fixed in Angular and AngularJS support.

Better 'null' and 'undefined' check

PhpStorm can now better detect situations that lead to a TypeError because a method is invoked on a value that is undefined or null, or it is passed to a function, or its property is used.

Vuetify support

PhpStorm now provides code completion for components from Vuetify version 1.1 or later.

React improvements

In React apps, code completion now suggests all component lifecycle methods. The Unresolved variable inspection will now warn you about any potentially undefined components.


As usual, all the features and improvements of WebStorm are available in PhpStorm, either out of the box or with free plugins available in the repository.

IDE

Search Everywhere

New search popup

The new Search Everywhere dialog is a better way to navigate the project and the IDE – search classes, files, symbols, and even actions and settings. Press Shift-Shift to search everywhere, and switch contexts by pressing Tab.

VCS

High-contrast theme

To make PhpStorm more accessible, we’ve added a new high-contrast UI theme. The IDE now allows screen readers to read line numbers, VCS annotations, breakpoints, and other gutter icons. Learn more about screen reader support in the documentation.

Database Tools

Improvements in Database tools

Database tools in PhpStorm have been improved thanks to our colleagues from the DataGrip team:

  • Cassandra database support
  • Many improvements in code completion
  • Support for extensions in PostgreSQL
  • Introduce table alias intention
  • Auto-reconnect after time-outs

Other improvements:

  • Ever struggled with finding variables while debugging? Start typing anything to Search variables in debug.
  • Run configurations for HTTP Requests are now supported and created for you automatically as soon as you run a request.
  • Aliases References In Italic help to distinguish real class names and aliased ones.
  • PhpStorm will autodetect Configuration for Test Frameworks based on the composer.json and dotfiles and automatically create Run Configuration to run tests.
  • You’ll be able to generate setUp and tearDown methods for PHPUnit which are called every time before and after running each test method, respectively.