What’s New in PhpStorm 2017.3

Experience The Drive to Develop with the third major update for PhpStorm in 2017.

Editor-based REST client

New REST client interface

New REST client interface

With the new REST client, all the powers of the PhpStorm code editor are now available for your REST requests. Use code completion to assist you with composing a request, apply refactorings to it, store the request as part of the project and add it to VCS, execute the request, and examine server responses – all without leaving the code editor.

Support for environment variables

Support for environment variables

Define environment variables to hold the values specific for your working environment, for example, the names of your development and production hosts. When composing a REST request, you can substitute its part with a variable to keep a single request suitable for multiple purposes.

Compare your requests

Compare your requests

The diff viewer now handles server responses. If you want to see how your changes affect the response, simply execute a REST request several times. Then, pick a pair of results, invoke the diff viewer right from the code editor, and examine the differences.

PHP Language

Performance Improvements

Performance Improvements

We’ve been working hard on performance improvements in this release. As a result, typing latency in very complex PHP files has decreased significantly. We’ve examined typing latency in the mPDF main file, which is a 38k-line-long mix of PHP, JS, and HTML, and it is down by 75% in PhpStorm 2017.3!

Support of nullability in refactoring

Support for nullability in refactoring

PhpStorm 2017.3 brings nullability support introduced in PHP 7.1, which is now available for the Extract Interface and Change Signature refactorings. It will help you avoid omitting the type declaration, or providing the default null value for the function parameter when you really want to pass or return null. PhpStorm will now preserve nullability when you apply Extract Interface and will no longer signal an error when it detects a nullable type while applying Change Signature.

Improved code templates

Improved code templates

To simplify the creation of classes in namespaced code, the New PHP Class dialog now lets you select a custom PHP file template. Use the ${NAMESPACE} variable in your template and take advantage of namespace completion and PSR-0 / PSR-4 namespace detection as you create the class.
You can also specify the day, year, and month in any PHPDoc template, not just in file templates.

Bring exceptions under control

New Inspection: Unhandled Exception

Unhandled exception

The new Unhandled exception inspection reports exceptions that are neither enclosed in a try-catch block nor documented using a @throws tag. The inspection helps you find all the places in your code where thrown exceptions would lead to a Fatal Error. Accordingly, you can resolve such issues by using quick-fixes like Add @throws tag and Surround with try/catch.

Redundant/Superfluous @throws tag

Redundant @throws tag

Ever forget to update your PHPDoc after refactoring your code? We’ve added the new Redundant @throws tag inspection, and the corresponding Remove @throws tag and Update PHPDoc quick-fixes will now help you clean up your PHPDoc.

Redundant catch clause

Redundant catch clause

The new Redundant catch clause inspection and the corresponding Delete catch clause quick-fix will let you know when the exception you are trying to catch is actually never thrown and therefore your catch block is redundant.

Testing

Create new Codeception test

Create new Codeception and PHPSpec test

The Create New PHP Test dialog adds new templates for the Codeception Unit, Codeception Functional, and PHPSpec test types so you can create new Codeception and PHPSpec tests with more ease.

Test method generation

Test method generation

No more manual creation of test methods! Use the brand new method selector in the Create New PHP Test dialog instead. Simply select all or just a couple of class methods for which you’re going to provide tests, and PhpStorm will generate the test class and the test methods stubs for you. Templates for all supported frameworks are provided to cover your needs for generating project-specific code.

Rerun of PHPUnit test with specific dataset

Rerun of PHPUnit test with specific dataset

In PhpStorm 2017.3, you can rerun a failed PHPUnit test with specific dataset. If you have a test method that uses the data provider and only one of the data sets fails, you don’t have to re-run the entire test anymore. Simply choose a specific data set from the previous test run and Run/Debug it again.

Undefined PHPUnit data provider

Undefined PHPUnit data provider

PhpStorm 2017.3 introduces the Undefined PHPUnit data provider inspection, which indicates a @dataProvider method that’s not found in unit tests. You can then easily create the missing method by applying the suggested Create data provider quick-fix.

Twig support

Injections in Twig templates

Injections in Twig templates

We’ve implemented language injections for Twig custom tags and named blocks. You can inject a language into the named block or between custom tags. You can also create permanent injection rules.

Improved Twig formatting

Improved Twig formatting

PhpStorm 2017.3 brings improved Twig formatting that can now handle complex structures and provide correct indentation for them.

Web Technologies Support

Improvements in Vue.js support

Improvements in Vue.js support

This update brings lots of improvements to PhpStorm’s support for Vue.js! Code completion and navigation to the definition now work for Vue props, properties in the data object, computed properties, and methods. Closing curly braces are now added automatically in Vue templates. We've also added a collection of code snippets for Vue. These code templates can help you save time typing some frequently used blocks of code. With a new Vue file template, you can also create new components faster.

Better code completion and documentation for JavaScript

Better code completion and documentation for JavaScript

Code completion and parameter info for the standard JavaScript objects and methods and Web APIs has improved, as these features are now powered by the TypeScript declaration files. The documentation available via F1 now also includes a brief description for methods, which either comes from the bundled definition files or is fetched from MDN.

New Pull Member Up refactoring

New Pull Member Up refactoring

With the new refactoring you can now move class methods up the class hierarchy – from your current JavaScript or TypeScript class to its parent class or interface. Or if there’s no parent class yet, you can extract fields and methods to a superclass using the new Extract superclass refactoring.

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. Other noteworthy web-related features include Extract type alias and Extract interface refactorings in TypeScript, multiple JavaScript versions in a project, improved Jest integration, better support for CSS, Import code style from ESLint and TSLint and other.

Version Control

Version Control

Version control comes with the following changes:

  • Switch between branches preserves your workspace
  • Changelists can now be renamed in the Shelf tab
  • D'n'D between Shelf and Local Changes tabs

Database Tools

Improvements in Database tools

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

  • Improved Database view
  • SQL generator
  • JOIN statement completion
  • SSH tunneling

Other improvements:

  • Redesigned Code Style|PHP settings page
  • New Composer Log
  • Improved PHPUnit Run configuration
  • Define visibility for initialize fields intention
Learn about PhpStorm 2017.2

Composer

New Composer Actions

New Composer actions

Now you can execute the actions Update Dependencies, Install Dependencies, Remove Dependencies, and Self-update directly from the IDE, without having to switch to the command line.

PhpStorm and Composer.json settings synchronization

PhpStorm and composer.json settings synchronization

Since composer.json contains the most up-to-date information about project, the synchronization of new settings between PhpStorm and composer.json ensures that PHP Language Level, PhpStorm Source and Test folders exactly match the project settings and structure specified in composer.json. This significantly simplifies project configuration in PhpStorm.

Global installation and easy project creation

Seamless work with composer global installation

Now you can use globally installed composer. PhpStorm detects whether you have it installed and simplifies project creation in case you do. You can also set globally installed composer for existing projects and make it default for all projects. All this will save you time that you spent on looking for the previously downloaded composer.phar or on downloading yet again composer.phar into the project.

PHP Runtime

Docker Compose

Docker Compose

PHP interpreter based on Docker Compose is now supported in PhpStorm. Now you don’t have to duplicate all settings, such as volumes, networks, environment variables, and others, from docker-compose.yml to PhpStorm. Docker Compose based interpreter includes all the familiar features of remote interpreters, so you can run/debug PHP code, and execute/debug PHPUnit, Codeception, Behat and PHPSpec tests.

Detection of enabled/disabled extensions from PHP interpreter

Detection of enabled/disabled extensions for PHP interpreter

In the previous PhpStorm release, we made it possible to configure which PHP extensions are used in the project. We’ve now added automatic detection of enabled/disabled extensions from the selected PHP interpreter. This will help you synchronize your project extension settings and extensions that are actually installed in your PHP distributive. The feature works for local PHP interpreters and for all types of remote ones as well.

Preserve state of Start Listening for PHP Debug Connection option

Preserve state of Start Listening for PHP Debug Connection option

In PhpStorm 2017.2, if you had Start Listening for PHP Debug Connection enabled in a project, the option will be restored on project reopening. This will help you avoid situations where debugging doesn’t work because you forgot to enable the option.

PHP Language Support

Reworked polymorphic types support

Reworked polymorphic types support

We’ve completely reworked support for polymorphic types, such as $this, static, self and parent. This fixes many related issues, for instance, missing type in chain call if a method has a double return type, lost type with new static() call if method from base class returns $this, returning self in traits not resolved correctly, and many others. In addition, we’ve improved support for composed traits.

Reworked polymorphic types support

Support of PHP 7.2 2017.2.1

PHP 7.2 is now in Beta and now you have a chance to experiment with the new version of PHP in PhpStorm. PhpStorm 2017.2.1 brings support for all the features of PHP 7.2, including a possibility for overriding of abstract methods, parameter type widening, trailing commas in list syntax, and object typehint.

Better Refactoring for PHP 7/ 7.1

Better refactoring for PHP 7/7.1

PhpStorm 2017.2 brings better refactoring for PHP 7/7.1. In particular, return types are now supported for the Change Signature refactoring, and the Extract Constant refactoring now allows you to use visibility level for constants.

$this highlighting

$this highlighting

In PhpStorm 2017.2, when you place your caret on $this, PhpStorm highlights all usages of this variable across the whole class. It can be extremely helpful as you can easily see all the usages of the variable.

New inspections

New inspections

PhpStorm 2017.2 bring new handy inspections, such as

  • Statement has empty body inspection
  • Usage of strict_types declaration for PHP 7 and higher
  • Method declaration of super class is incompatible with implemented interface
  • Short open tag usage inspection 2017.2.1

Testing

Automatic run of PHPUnit tests

Automatically run PHPUnit tests

In PhpStorm 2017.2, you can re-run PHPUnit tests automatically with a specified delay. Enable auto-run for a particular configuration, set the delay value, and your tests will be re-run automatically with that delay after you stop editing a file.

Unified Test Frameworks settings

Unified Test Frameworks settings

We continue to simplify and unify PhpStorm settings. In this small but pleasant update, PHPUnit, Behat, PHPSpec, and Codeception testing frameworks have a single settings page.

Improved PHP Formatting

New formatting options

New formatting options

PhpStorm 2017.2 brings new useful code style options:

  • Spaces around null coalescing operator
  • New formatter options for blank lines
  • New parenthesis options for if statements
  • Separate option for brace placement for closures
  • New Return type on new line option

Web Technologies Support

Support for webpack enhanced module resolution

Support for enhanced webpack module resolution

Coding assistance in JavaScript files now respects webpack module resolution. This means that now, if you’re using a complex webpack configuration with aliases and multiple modules, PhpStorm will properly resolve the import statements.

Import from ESLint

Import from ESLint

You can now import some ESLint code style rules to the IDE’s JavaScript code style settings. Reply ‘Yes’ when prompted about this in the .eslintrc file to apply the matched rules and make the IDE formatting more consistent with your ESLint configuration.

Rearrange code for JavaScript and TypeScript

Rearrange code for JavaScript and TypeScript

The new code style options allow you to configure how different blocks of code such as the constructor, fields and methods are ordered in your JavaScript and TypeScript classes. Call the Rearrange Code action or use it together with Reformat Code to make code more readable and consistent.

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. Other noteworthy web-related features include support for Angular Material, parameter hints and type info in TypeScript, move symbol refactoring, and other.

IDE Improvements

Version Control

Version control

Version control comes with the following changes:

  • Reverting and rewording commits
  • Formatting commit messages
  • Reworked Shelf
Find in Path

Find in Path improvements

The Preview panel in Find in Path now has a “gutter” – a left-side pane like that in the editor – with line numbers, navigation icons, and local change markers. In addition, search results from the same lines are now merged together.

Pause indexing

Pause indexing

The indexing process now can be paused, for instance, if you need your CPU power for an urgent task.

Database Tools

Improvements in Database tools

Improvements in database tools

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

  • Several databases in one PostgreSQL data source
  • Get notified when a large query is finished
  • Transaction Control

Other improvements:

  • Unified settings for PHP frameworks
  • SSH-Agent support
  • Create new field/method actions for PHP UML diagrams
  • Better HiDPI support
  • Blade: support for @guest and @endguest2017.2.1
  • Navigation to an appropriate loop from break/continue2017.2.1
Learn about PhpStorm 2017.1

Tools and Frameworks

Support of Codeception testing framework

Support for the Codeception testing framework

PhpStorm now supports the Codeception testing framework, starting with version 2.2.0. You can install it from Composer or PHAR. Run Configuration will help you run your tests locally, on a Vagrant machine, remote interpreter, or Docker.

Read more..

Support of PHPUnit 6

Support for PHPUnit 6

PHPUnit 6 was released just recently, and now we are bringing support for it in PhpStorm. The new namespaced TestCase class is now recognized and supported by PhpStorm.

Read more..

Blade Support Improvements

Blade support improvements

Good news for Laravel developers: PHPDoc in Blade injections is now supported. You can provide the type of variable inside a template to get code completion. Other improvements include support for @includeWhen, @component, and @slot directives, which are now nested in the document structure.

Read more..

Joomla! Support

Improved Joomla! Support 2017.1.1

In addition to other Joomla! Support features, we’ve added initial support for JDatabaseQuery and JDatabaseDriver. When working with these classes, you will now get completion for tables and columns, as well as inspections, SQL highlighting, and table/columns resolve.

Editing Experience

Parameter Hints

Parameter hints

Thanks to Parameter hints in PhpStorm, code becomes more readable and easier to understand. Parameter hints are now shown for literals and nulls used as method arguments, helping you better understand the semantics of specific methods. We've also added an option to customize your inline parameter hints to fit your IDE color scheme.

Read more..

2017.1.1 New option is added to always show parameter name hints independent on the statement that expresses the parameter value.

PSR-0 Support

Better support of PSR-0 and Rename refactoring

Now if you use Rename refactoring for a directory in PSR-0 root, it also changes the namespace of your class, and vice versa, when you rename a namespace. In addition, the Rename Class refactoring renames child classes and their files as appropriate.

Recognition of PHP class names in strings

Recognition of PHP class names in strings

PhpStorm 2017.1 recognizes PHP class names in strings. Class references will be now added to string literals in single quotes that will help you maintain the correct names in the Rename refactoring and navigate to classes more quickly.

Improved PHP Formatting

Improved PHP formatting

PhpStorm 2017.1 brings several new useful code style options, such as:

  • Configurable spaces inside declare statements
  • Place ‘()’ for constructor
  • Convert else if/elseif to
  • Blank lines before namespace

Read more..

Improvements in Auto-Import Functionality

Auto-import of functions and constants

Auto-import of functions and constants

PhpStorm 2017.1 can now automatically import functions and constants. To take advantage of this, go to in Settings | Editor | General | Auto Import | PHP and select Enable auto-import in file scope and/or Enable auto-import in namespace scope.

Auto-import from global namespace

Auto-import from global namespace

As an alternative to auto-importing functions and constants from the global namespace, you can ask the IDE to use global references. You can find this option in Settings | Editor | General | Auto Import | PHP | Prepend functions and constants from the global space with ‘\’.

PHP Language Support

Full support of PHP 7 Uniform Variable Syntax

Full support of PHP 7 Uniform Variable Syntax

PhpStorm 2017.1 brings improvements for PHP 7 Uniform Variable Syntax in accordance with PHP RFC: Uniform Variable Syntax. Expressions such as isset/unset, foo()()().., and $some->foo()() style calls are now supported.

PHP 7.1: Improved support for anonymous classes

PHP 7.1: Improved support for anonymous classes

We’ve added support for anonymous classes, which now have a proper type, meaning that methods of anonymous classes will be correctly resolved. This unleashes the full power of PhpStorm, including Code Inspections, Find Usages, Rename Refactoring, Navigate to Declaration and more.

New code highlights

New code highlights

PhpStorm 2017.1 brings new highlighting of all extended/implemented methods, places where an import is used, and places where an exception is thrown (for try, catch, and @throws). This way your code is more visual, and it’s easier to grasp the important details. To use this feature, simply place the caret on extends, implements, use, catch or @throws.

Extended PHP Runtime Configuration

Configurable PHP runtime

In PhpStorm 2017.1 it is possible to configure which PHP extensions are used in the project. It will help to keep completion lists neat and containing only relevant items.

Read more..

2017.1.1 Disabled extension stubs which are actually used in a project are automatically detected and can be fixed with a quick-fix.

Recursion detection

Recursion detection 2017.1.1

Now when there’s recursion in your code, it will be automatically detected and marked with a special symbol on the left side panel.

Code Quality Analysis

Detect and convert PHP 4 style constructors to PHP 5.3+

Detect and convert PHP 4 style constructors to PHP 5.3+

Since PHP 4 constructors have been deprecated in PHP 7, we’ve added a new inspection to help detect and convert such constructors to PHP 5.3+ style –__construct. You can also press Alt+Enter for a related quick-fix.

Read more..

New quick-fix for undefined variables

New quick-fix for undefined variables

New quick-fix was added to help to resolve undefined variables by declaring it as imported in closure.

PHP Debugging

Grouping of user-defined constants in Debugger

Grouping of user-defined constants in Debugger

Now all user-defined constants are grouped under the Constants node in the list of variables, which helps reduce the noise and keep the list of variables neat.

Read more..

Allow choosing IP to be sent to Zend Debugger

Allow choosing IP to be sent to Zend Debugger

PhpStorm 2017.1 automatically detects all host IPs to sent them to Zend Debugger. This is especially important when working on a machine with multiple IPs, e.g. if you use Vagrant/VirtualBox/VPN. You can also disable the check-box and provide required IPs manually. The option can be found in Settings|PHP | Debug | Automatically detect IDE IP.

Possibility to skip files in step debugging

Skip files in step debugging 2017.1.1

Now you can skip files when Stepping Into (F7) during debugging. It might be especially useful when working with large frameworks where skipping core files during step debugging can save a lot of time. Enable the option in Settings | Languages & Frameworks | Debug | Step Filters.

Top-notch Web Technologies

Flow

Vue.js support

Enjoy coding assistance for Vue template language and the language of your choice in the script and style blocks of a .vue file. The IDE automatically completes Vue components and adds required imports for them. And we’re just getting started!

Integration with Jest

Integration with Jest

Thanks to the new integration with Jest, you can now run Jest tests from the IDE, see test results in a handy treeview, easily navigate to the test source from there, and also debug Jest tests.

Completion for modules in package.json

Completion for modules in package.json

PhpStorm now suggests package names in the project’s package.json file, and shows descriptions and latest versions for them.

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 upgrade your code to ECMAScript 6, and more.

IDE Improvements

Version Control

Version control

Version control comes with the following changes:

  • Updated Log viewer for Git and Mercurial
  • New option called Ignore imports and formatting in the Diff dialog
  • Faster File History performance for Git
Ability to open several PhpStorm projects in one frame

Search in Find in Path

The Find in Path dialog, which earlier received a Preview tab, has been reworked from the ground up and now shows instant results in the first place. What is more important, now you can open any selected result in the Editor simply by pressing Enter. To see results in the tool window, either click the button at the bottom or press Ctrl+Enter (Cmd-Enter for Mac OS X).

Database Tools

Improvements in Database tools

Improvements in database tools

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

  • Better schema management in the Data Sources and Drivers dialog
  • Сolumns mapping and DDL preview in CSV import
  • Drag-n-drop for exporting/importing tables

Learn more..

Other improvements:

  • Drag’n’Drop to/from Remote Host copies files instead of moving
  • Support for function/constant/namespace aliases in unused imports
  • Support for emoji in the editor
  • Auto import for React components
  • New Copy Type and Jump to Type Source actions from the Debugger Variables View
  • Option to ignore imports and formatting in the Diff dialog