What’s New in PhpStorm 2016.2

This is the second update in the series of the releases planned for 2016. Take advantage of even better code understanding, top-notch coding assistance, and support for all major tools and frameworks.

Better PHP Language Support

Improved type inference

Improved type inference

Major improvements were made in type inference:

  • Type inference of array elements from PHP array functions
  • Extended type of already inferred variables instead of rewriting
  • Type inference for elements and keys of Iterator and IteratorAggregate implementators
  • Improved PhpStorm advanced metadata
Strict type inspection for PHP 7

Strict type inspection

In PhpStorm 2016.2 we’ve added a new strict type inspection for PHP 7. With this type hinting support, PHP 7 support in PhpStorm gets even better.

Read more about PHP 7 Strict Type Inspection

Improved parsing of PHP 7 and PHP 7.1

Improved parsing

Parsing for PHP 7 and PHP 7.1 has been significantly improved. We’ve added support for PHP 7 Uniform Syntax. Moreover, PHP 7.1 is now supported, including support of visibility modifiers for class constants, keys in the list() construct, null return types and nullable arguments, and multiple catch exceptions.

Improved getters and setters generation

Improved getters and setters generation

If language level is set to PHP 7 or higher, PhpStorm will generate getters and setters with return type and scalar parameter type hint.

New Editing Experience

Completion Improvements

New completion features

A new dynamic live template was added to make completing the parameters passed into functions, methods, or class constructors easier. Values of class constants are now shown in the completion lists, and static methods are filtered out from the completion lists.

Read more about parameter code completion

Smart Type Code Completion

Smart type code completion

Smart Type code completion filters the suggestion list and includes only those types that are applicable to the current context. You can invoke it by pressing Ctrl+Shift+Space.

Read more about completion changes

Various @throws improvements

Various @throws improvements

In PhpStorm 2016.2 you will find a new option to analyze more than one call level for @throws generation and inspection. Also, you now have one unified setting which controls both generation as well as inspection for @throws tags.

Read more about @throws improvements

Code Quality Analysis

Import Cleanup Improvements

Unused imports inspection

In PhpStorm 2016.2 we have completely reworked inspection of unused imports that now includes support for namespaces, functions and constants, and added other enhancements.

Read more about Unused Imports Inspection

Return Type Inspection

Return type inspection

Now if a declaration of a return type in phpDoc isn’t compatible with the actual return type of a method or a function, the IDE will alert you to this. Return type can now be changed with an automatic quick-fix.

Dynamic Call to Static Method Inspection

Dynamic call to static method inspection

PhpStorm 2016.2 brings a new inspection for calling a static method in a dynamic manner (via -> instead of ::). A new quick, Make call static, was added to make this inspection more helpful for you. This feature is switched off by default; to start using it, adjust the setting at Preferences | Editor | Inspections | Static method called as dynamic.

Frameworks, Tools, and more

Template Projects

Template projects

In PhpStorm 2016.2, you can save any project as a template and create a new one based on it. The Tools menu has a new action, Save Project as Template. As soon as it’s saved, the Template is available as a user-defined template in the New Project window.

Read more about Template Projects

Joomla Support

Joomla! support

In PhpStorm 2016.2, we’ve added support for Joomla! Framework. PhpStorm now bundles the Joomla! Plugin providing many Joomla!-specific features, such as Joomla! Code Style, support for JHtml::_($argument) and JText::_($argument), database prefix support, and more. You can easily add Joomla! Support to your existing project or create a new Joomla! Module/Plugin/Extension right from the Welcome screen.

On demand load of Debug Extension for CLI configurations

Xdebug on demand for CLI PHP scripts

In PhpStorm 2016.2 you can load a Debug Extension for CLI on demand, e.g. when Debugger/Code coverage is required. This dramatically increases execution speed, by a factor of 2 to 3 in specific cases.

Read more about Xdebug on demand for CLI PHP scripts

Top-notch Web Technologies

TypeScript 2.0 support

TypeScript 2.0 support

PhpStorm 2016.2 brings support for many features of TypeScript 2.0: optional class members, readonly property, never type, this function type, global module export declaration, resolve for type declarations in @types folder, path mappings based module resolution, and more.

Angular CLI and code snippets

Angular CLI and code snippets

Thanks to the integration with Angular CLI, you can now create new Angular 2 projects from the IDE Welcome screen. And with a collection of Angular 2 Live templates, you’ll have the most used code snippets at your fingertips.

Drag files into HTML

Drag files into HTML

Drag an image to add an img tag with width and height attributes anywhere inside the body tag. Similarly, drag a JavaScript or CSS file into the opened HTML file, and PhpStorm will automatically create a script or a link tag inside the head tag for you.

As usual, all features and improvements of WebStorm are available in PhpStorm either out of the box or with free plugins available in the repository. Other noteworthy web-related features include improved React support, support for jspm imports, Convert to arrow function to help you to upgrade your code to ECMAScript 6, and more.

IDE improvements

Version Control

Version control

Version Control comes with the following changes:

  • Improvements in working with patches
  • Commit dialog now shows unversioned files
  • Case only rename for Git
  • Improved Git/Mercurial Log Viewer
UI Improvements

UI improvements

PhpStorm 2016.2 borrows from the platform great UI improvements, such as:

  • Watches view has been merged with Variables
  • Redesigned Inspection tool window
  • Better notifications
  • Set Background Image action
Support for fonts with ligatures

Support for fonts with ligatures

The editor in PhpStorm now supports fonts with programming ligatures, like Fira Code, Monoid or Hasklig. Make sure you enable that in Preferences | Editor | Colors and Fonts | Font.

Database Tools

database improvements

Database tools improvements

Database tools have been improved thanks to our colleagues on the JetBrains DataGrip team:

  • CSV files import
  • Language injections
  • Improved table editor

Learn more