What’s New in PhpStorm 2019.3

Experience hyper-productivity with this major IDE update

PHP 7.4 Support

PHP 7.4 is now released, and PhpStorm 2019.3 fully supports all its new features. The IDE also offers inspections to highlight deprecations and quick-fixes for upgrading your codebase.

Typed Properties

Typed Properties.

We added support for typed properties back in the 2019.2 release. In v2019.3, the quick-fixes can handle all the corner cases, and you can quickly and easily add type declarations by pressing Alt-Enter and choosing Add declared type for the field. PhpStorm will detect the type automatically based on the PHPDoc, default value, or argument type declaration in the constructor.

Arrow Functions

Arrow Functions.

PhpStorm fully supports the brand new short syntax for one-line lambda functions in PHP 7.4. The IDE provides completion for variables from the outer scope, and, with one click, PhpStorm will take you to the declaration.

A quick-fix to convert one-line lambda functions from the old syntax to the new short one is also available. Just press Alt-Enter over an anonymous function and choose Convert closure to arrow function.

Numeric Literal Separator

Numeric Literal Separator.

In PHP 7.4, you can add underscore separators to a long number to visually format and improve the readability of your code.

If you see a long number, place the caret over it, press Alt+Enter, and select Add number separators. This will add an underscore '_' after every third digit for decimal numbers, or every fourth digit in hex, binary, and octal.

Nested Ternary Operator

Nested ternary operator.

PHP 7.4 deprecates left associativity for nested ? : operators. This means that either you should not use nested ternaries at all, or, if you have to, you should use parentheses to explicitly declare the order of computation.

PhpStorm 2019.3 will highlight deprecated expressions and will provide you with a quick-fix to clarify the behavior.

Deprecations

Deprecations.

This PHP release not only added new features but also deprecated many old ones.

PhpStorm 2019.3 has the corresponding inspections and will highlight pieces of code that need your attention. Where possible, you’ll have an option to quick-fix the deprecated behavior automatically.

Covariant Returns and Contravariant Parameters

Covariant Returns and Contravariant Parameters.

PHP 7.4 fixes multiple inconsistencies, including one affecting the type system. When you work with a method inherited from a parent class, it will now be possible to define a more specific return type, and less specific parameter types for it.

PSR-12

The new PSR-12 code-style standard extends the previous PSR-2 with additional rules and new guidelines for some of the new PHP features. PhpStorm 2019.3 comes with a predefined PSR-12 code style, and the IDE will suggest that you switch to it. You can also switch to it manually via the Set from… action under Preferences | Editor | Code Style | PHP.

PhpStorm also suggests enabling a set of PSR-12 code style inspections, which will check for certain rule violations.

You can reformat your code in the editor by pressing Cmd+Alt+L or run it before committing. You can also reformat the whole project or folder with Code > Code Cleanup...

WSL

The Windows Subsystem for Linux is a compatibility layer for running Linux binary executables natively on Windows 10. PhpStorm now supports developing in a WSL environment, which is when you launch the IDE on a Windows machine but you target WSL/Linux in your development. You can specify a remote PHP interpreter in the WSL and use it for running scripts, tests, and Composer commands, and for debugging.

Specify the interpreter for PHP test run configurations

Specify the interpreter for PHP test run configurations

It used to be that your test run configurations could only be executed through the default project PHP interpreter, which could be kind of inconvenient.

This is no longer the case. In PhpStorm 2019.3, you can choose any interpreter that you have configured, and run your tests with it: Docker, Vagrant, via SSH, WSL, or anything else – you name it, the choice is yours!

And even more

PHPDoc Improvements.

PHPDoc Improvements

Traditionally in PhpStorm, the entire PHPDoc block was displayed in one color and styled just like the regular comments.

Now, doc blocks will have full highlighting for all the types, variables, params, methods, and properties. If you have HTML in your comments, it will also be highlighted as such.

Fonts and colors for $this variable

Fonts and colors for $this variable.

You can choose the font face and colors for $this occurrences: go to Preferences | Editor | Color Scheme | PHP | Identifiers and customize it the way you want.

PHP Highlighting in Markdown and Strings

PHP Highlighting in Markdown and Strings.

In PhpStorm 2019.3, PHP code blocks in Markdown files will be automatically highlighted if you’re using ‘php’ as an info string. You can also get highlighting for PHP for the other strings thanks to a special PHP dialect called InjectablePHP, which works similar to PHP, but does not require an opening tag.

Context actions for if-else

Extract assignment.

Extract assignment

Merge nested conditions

Merge nested conditions

Merge else followed by if

Merge else followed by if

HTTP Client

Check out this short video tutorial on using the HTTP Client in PhpStorm to make requests like a pro.

Editor toolbar.

Editor toolbar

Whenever you open an .http file, you will now get a toolbar which gives you quick access to all the common actions:

  • Add request – create requests from templates.
  • Convert from cURL – create requests by pasting a cURL in the editor.
  • Open Log – view the list of sent requests and open/compare the responses.
  • Examples – explore a collection of handy HTTP requests.
Dynamic variables.

Dynamic variables

We’ve added three dynamic variables that you can use in the requests:

  • $uuid – Generates a new UUID-v4.
  • $timestamp – Current Unix timestamp.
  • $randomInt – A random integer between 0 and 1000.

Use double curly braces to insert these variables where you need to.

Run all.

Run all

You can write multiple requests in one .http file. This is quite convenient if you need to do request chains where a request depends on the result of the previous ones.

Earlier, you had to run each request one by one, now in PhpStorm 2019.3, you are able to run them all with one click!

Folding requests.

Folding requests

If you are sending a request with a long body, for example, multipart form data or maybe many headers, you may want to fold it to reduce noise in the editor.

You can fold the whole request leaving only the first line or the body by clicking the arrow icon in the gutter.

Web Technologies

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

More advanced Vue.js support.

More advanced Vue.js support

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 it will suggest simplifying it.

Completion for CSS libraries on CDN.

Completion for CSS libraries on CDN

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

Name suggestions for new symbols.

Name suggestions for new symbols

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.

Version Control

New UI for cloning projects from the VCS and GitHub

When you clone a project out of a version control system, from either the IDE Welcome screen or the VCS menu, you will see an updated Get from Version Control dialog.

With this redesign, we hope to improve the experience of getting a project from your GitHub account. You can now select GitHub on the left-hand side of the dialog and log in to your account from there.

Push any branch

You can now push changes from any branch directly from the Branches popup – select a branch and then use the Push action in the menu.

Previously, you could only push changes from the branch you were currently working with, and to do this, you would have had to have switched to the branch first before you could push the changes.

Date format customization

Date format customization

Sometimes, when looking through the version history log, it’s easier to comprehend the information if the time is displayed in a relative format like dd/mm/yyyy or mm/dd/yyyy if you are from the US.

In PhpStorm 2019.3, it is possible to configure the date format for VCS Annotate and VCS Log actions.

Database Tools

The database tools in PhpStorm have had some cool improvements made to them thanks to our colleagues from the DataGrip team. Take a look at What’s new in DataGrip 2019.3.

MongoDB Support

The highly anticipated support for MongoDB has finally made it into JetBrains IDEs, including PhpStorm. It comes with the ability to see collections and fields in the database explorer, view the data with support for tree view. You can also sort by columns or filter the values, and last but not least, run queries right inside the IDE.

Other Improvements:

  • Faster startup – now you don’t have to wait nearly as long before the welcome screen displays and the IDE opens up with projects already indexed.
  • Better plugin management – the IDE no longer needs to restart when you add/remove theme plugins.
  • Improved Kubernetes support via the plugin.
  • Contrast scrollbars – Preferences/Settings | Appearance & Behavior | Appearance and enable the “Use contrast scrollbars”.
  • Search in a selected area when using the Find action.
  • Smooth mouse scrolling – Preferences | Appearance & Behavior | Appearance > Smooth scrolling.
Learn about PhpStorm 2019.2

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.