PhpStorm 2018.1. EAP 181.3494.16

The new PhpStorm 2018.1 EAP build (181.3494.16) is now available! You can download it here or via JetBrains Toolbox App. Or, if you have the previous PhpStorm 2018.1 EAP build (181.3263.18) installed, you should soon get a notification in the IDE about a patch update.

This build delivers new features, bug fixes, and improvements for PHP and the Web, and includes the latest improvements in IntelliJ Platform.

REST Client: assertions support

We continue development of the new REST client, and in this EAP we’ve added support for assertions. The client object has received two new methods: test and assert. You can create a new test by using the following syntax:

Inside a test body, you can call client.assert(assertion, “Failure message”), where assertion is any expression evaluating to a Boolean. You can use any JavaScript (ECMAScript 5.1) code inside your test, for example, string.search method, if statements, and so on. Having written your test, execute a request and see the results of the tests in Tests tab.

rest_tests

We encourage you to try the new feature and share your thoughts on what is missing and which assertion would you like to see in future!

Codeception: code coverage support

This build brings code coverage for Codeception, that many of you have asked us to implement. It works exactly like PHPUnit coverage: simply press the Run with coverage button near the existing Codeception configuration, or right-click anywhere inside a Codeception class or method and select this item from the context menu. You will see the coverage results in the Project view as well as in the code editor’s left gutter: the covered code lines will be indicated with the green markers, while the uncovered lines – with red markers.

codeception_coverage

We’re reusing the Codeception configuration so you will need to have coverage configured on the Codeception side. You can read more about how to do that in the Codeception documentation.

Other features worth noting:

  • URL links in comments are not clickable in the editor WI-28548 
  • Suggest @internal and @deprecated last when autocompleting WI-37750 

Apart from new features, this build brings many important bug fixes and usability improvements, including these:

  • Fixed: Class aliases should be ignored if the class declaration with the same FQN exists WI-40295 
  • Fixed: search everywhere doesn’t get focus IDEA-124160 

See the full list of bug-fixes and improvements in our issue tracker and the complete release notes.

Download PhpStorm 2018.1 EAP 181.3494.16 for your platform from the project EAP page or click “Update” in your JetBrains Toolbox App. And please do report any bugs and feature request to our Issue Tracker.

Your JetBrains PhpStorm Team
The Drive to Develop

Posted in Early Access Program | 5 Comments

PHP Annotated Monthly – February 2018

PHP Annotated Monthly LogoIt’s February already! As the year rolls along relentlessly, here are all the links to all the blog posts you need to read curated by Gary Hockin, Developer Advocate for PhpStorm.

Continue reading

Posted in PHP Annotated Monthly | Tagged , , | 21 Comments

Getting PhpStorm ready for Xdebug 2.6

When it comes to PHP debugging, Xdebug is the de-facto standard. With the 2.6 version released last week, it’s a good time to take a look at the new features. And since Xdebug has always been tightly integrated with PhpStorm, we’ve been preparing ourselves for it, too.

Continue reading

Posted in Cool Feature, Newsletter | Tagged , | 2 Comments

How PhpStorm helps bitExpert developers be more productive – Case Study

In this post, we are happy to present to you an interview with Stephan Hochdörfer, Head of Technology at bitExpert. Stephan shares his insights on PhpStorm and tells us how PhpStorm helps bitExpert developers be more productive and experience the power of a “toolset that just works.”
bitExpert

Continue reading

Posted in Newsletter, Sales and Promotions | Leave a comment

PhpStorm 2018.1. EAP 181.3263.18

The new PhpStorm 2018.1 EAP build (181.3263.18) is now available! You can download it here or via JetBrains Toolbox App. Or, if you have the previous PhpStorm 2018.1 EAP build (181.3007.10) installed, you should soon get a notification in the IDE about a patch update.

This build delivers new features, bug fixes, and improvements for PHP and the Web, and includes the latest improvements in IntelliJ Platform.

Configurable unchecked exceptions

In the last release, we’ve implemented new inspections that help you to find uncaught exceptions as well as to find redundant @throws tags. It was possible to ignore \Runtime and \Logic exception and all their children, but we were asked to make a configurable list of unchecked exceptions.

In this build, we added the list that can be found at Preferences | Languages & Frameworks | PHP | Analysis tab. To cover most cases, we extended the list with \Error and \PHPUnit\Exception. PhpStorm takes into account not just listed exception but all children classes as well. You can add your specific exception that shouldn’t be caught but we encourage you to keep the list as short as possible to avoid missing a real exception.

unchecked_exceptions

REST Client: support for response handler scripts

We continue improving REST client and in this build, we’ve added a way to run custom JavaScript code (ECMAScript 5.1 specification) to generate and manipulate variables that can be used later in HTTP requests.

We provide two additional objects:

  • client stores meta information about the session, it can be modified inside a script and it will preserve its state till IDE will be closed. All variables saved in client.global can be used in subsequent HTTP requests as {{variable_name}}
  • response holds information about the response, i.e. content-type, status, response body.

Objects completion and documentation are already enabled in in-place scripts. To enable completion in a separate javascript file open a context menu in a target file, select Use JavaScript Library and select HTTP Response Handler.

rest_js

PHPUnit: Gutter icons for running tests

There is a fantastic PHPUnit Enhancement plugin that provides additional PHPUnit specific completion, navigation, and support of Prophecy. It also adds gutter icons to run the tests. Unfortunately, the current implementation has its limitations.

We’ve decided to implement gutter icons for PHPUnit tests right in the PhpStorm core. PHPUnit gutter icons support different type of running tests (Run, Debug, Run with Coverage), works with Local as well as Remote Interpreters and shows the previous execution state (passed, failed, not started).

Please vote for issue in case you see double icons.

phpunit_gutter

Other features worth noting:

  • Spellchecker gives very small amount of suggestions WI-705 
  • Support PHPUnit @coversDefaultClass annotation WI-30157
  • REST Clien: Show documentation for header fields WEB-30841 
  • Actions to navigate to prev/next occurrence of identifier under caret IDEA-59638 
  • Use yarn instead of npm if yarn is installed WEB-27974 

Apart from new features, this build brings many important bug fixes and usability improvements, including these:

  • Can’t typehint a class with the name “Resource/Bool/Integer/Object” WI-15619 
  • Wrong PHPDoc parameter type generated for variadics WI-29429 
  • Wrong PHPDoc formatting with Brackets WI-31025 

See the full list of bug-fixes and improvements in our issue tracker and the complete release notes.

Download PhpStorm 2018.1 EAP 181.3263.18 for your platform from the project EAP page or click “Update” in your JetBrains Toolbox App. And please do report any bugs and feature request to our Issue Tracker.

Your JetBrains PhpStorm Team
The Drive to Develop

Posted in Early Access Program | 13 Comments

PhpStorm 2017.3.4 is released

PhpStorm 2017.3.4 build 173.4548.32 is now available! You can download it here, in JetBrains Toolbox App or if you have installed the previous PhpStorm 2017.3.3, you should soon get a notification in the IDE about a patch update.

This build delivers bug fixes and improvements for IntelliJ Platform.

Notable bug fixes and features worth mentioning:

  • Fixed: Allow UI scale exceed 2x IDEA-171404 
  • Fixed: Multiple “Updating indices” bg tasks after external file system changes IDEA-123287 
  • Fixed: Evaluate window: cannot TAB from expression into results tree IDEA-158873

See the full list of bug-fixes and improvements list in the complete release notes.

Download PhpStorm 2017.3.4 build 173.4548.32 for your platform or click “Update” in your JetBrains Toolbox App and please do report any bugs and feature request to our Issue Tracker.

JetBrains PhpStorm Team
The Drive to Develop

Posted in Newsletter, Release Announcements | Tagged | 25 Comments

Refactor your code to functional style with PhpStorm 2018.1

How many times you wrote code like this to achieve a simple purpose?

Mapping values of an array:

Filtering:

Or reducing an array to some value:

The above code samples involve the imperative programming style, which is familiar to everybody. It has a certain flaw: we have to parse the code in our head and go through negligible but required details to understand it.

To solve this issue, PHP suggests relying on the built-in functions: array_map, array_filter, array_reduce, etc. These functions can improve readability and emphasize the intent of your code. Unfortunately, it’s not always clear when and how to apply them to the existing code, since in some cases details can be crucial.

To help you with the task, we are going to introduce automatic ways of transforming imperative code to functional equivalents via the corresponding inspections and quick fixes. Since there can be a lot of tricky cases and possible transformations, we’ve decided to start with the simplest case of the foreach to array_map transformation inspection and quick fix.

In PhpStorm 2018.1 EAP, you can find the new Loop can be converted to ‘array_map’ call inspection under Settings | Editor | Inspections | PHP | Code Style and apply the corresponding quick fix as usual, by pressing Alt + Enter.

array_map_3

Should you reconsider, the ‘array_map’ call can be converted to loop inspection and quick fix, which do exactly the opposite, are provided, too.

We’re going to add more transformations and cover more cases in the future.

What do you think about functional programming in PHP? What types of transformation do you find the most useful? Give us your opinions in the comments or tweet @phpstorm!

Your JetBrains PhpStorm Team
The Drive to Develop

Posted in Cool Feature | Tagged , | 9 Comments

PhpStorm 2018.1 Early Access Program is Open

Today we start the Early Access Program for PhpStorm 2018.1 (EAP). A fresh build 181.3007.10 is available for download here and within the JetBrains Toolbox App.

What is Early Access Program?

Early Access Program (EAP) allows you to try pre-release versions of our software to evaluate features that will be added in the next release. It is important to distinguish EAP from traditional pre-release software. Please note that the quality of EAP versions may at times be far below even usual beta standards. If you are looking for a stable version of PhpStorm, please visit our site.

webide_logo

This build delivers new features, bug fixes and improvements for PHP and the Web, and includes the latest improvements in IntelliJ Platform.

Continue reading

Posted in Early Access Program, Newsletter | 26 Comments

Hunspell dictionaries support

PhpStorm is a polyglot IDE: it understands PHP, JS, CSS, HTML, and many other languages and will provide you with smart interpretation to assist you with writing your code. But what about human languages? English is the only language supported out of the box, and up until recently, you could only check your spelling in PhpStorm against a plain list of words.

This changes with PhpStorm 2017.3.2, since we are introducing support for Hunspell dictionaries.
Continue reading

Posted in Cool Feature, Newsletter | Tagged , | 3 Comments

PhpStorm 2017.3.3 is released

PhpStorm 2017.3.3 build 173.4301.34 is now available! You can download it here, in JetBrains Toolbox App or if you have installed the previous PhpStorm 2017.3.2 or PhpStorm 2017.3.3 EAP build (173.4301.24), you should soon get a notification in the IDE about a patch update.

This build delivers new features, bug fixes and improvements for PHP and the Web, and takes on the latest improvements in IntelliJ Platform.

REST Client: Auto-formatting of responses

In this build, we’ve implemented one of the new REST client’s most voted features: auto-formatting of request results. PhpStorm analyses Content-Type and formats the response accordingly. If type detection has failed for some reason, you can still choose between JSON, HTML and XML formatting manually. To see the original response, you can select the View as Text formatting type.

format_rest

Highlighting call-site in case of pass-by-reference

PHP 7.3 may introduce “Explicit call-site pass-by-reference” (RFC) that will allow prepending of a call-site argument with &. This should help to understand the code and notice possible unexpected changes of a variable. It’s still a year till the 7.3 release, but why wait?

In this build, we’ve extended parameter hints with pass-by-reference visualization that will help you find a function or a method call that has reference declaration in a parameter. The new parameter hints will be shown for all arguments that are actually passed by reference. Please share your feedback about the new feature!

pass_by_ref

Notable bug fixes and features worth mentioning:

  • Fixed: Short syntax array destructuring does not allow skipping values: WI-34517
  • Fixed: Unhandled exception: doesn’t analyze “new MyClass” (constructor) expression: WI-37946
  • Fixed: Broken “Change to” spelling quickfix in the Commit dialog: WI-39142
  • PHP New Class now saves previously selected template: WI-39427
  • Fixed: “Can’t run 32-bit version on Windows”: JRE-590
  • Fixed: All run configurations lost after upgrade to 2017.3: IDEA-182966
  • Fixed: Tool Window docking issue IDEA-149061
  • Fixed: FETCH ALL IN <cursor name> returns error <failed to load> org.postgresql.jdbc4.Jdbc4ResultSet: DBE-2465
  • Fixed: DataGrip does not recognize Redshift’s WITH NO SCHEMA BINDING clause: DBE-5404

See the full list of bug-fixes and improvements list in our issue tracker and in the complete release notes.

Download PhpStorm 2017.3.3 build 173.4301.34 for your platform or click “Update” in your JetBrains Toolbox App and please do report any bugs and feature request to our Issue Tracker.

JetBrains PhpStorm Team
The Drive to Develop

Posted in Newsletter, Release Announcements | Tagged | 13 Comments