PhpStorm users saw the release of the long awaited new version – PhpStorm8, this week. This major update brings a lot of new features to the popular IDE, so it’s a great time to review some of it’s most useful features.

Fuzzy Search: Ctrl+Shift+N

The PhpStorm search allows you to search all files and classes within a project, but the best part about this is that the search is “fuzzy”; meaning that it will match parts of the string so you do not need to be very precise.

For example, the string: “usfa” will match the below:

  • UserFactory.php
  • (Class) UserFactory

This makes it incredibly easy to find the files you want to edit fast. This is one of our favourite shortcuts which we use hundreds of times a day.

Refactor Tools

Refactoring is an essential part of the development process, and PhpStorm takes some of the more repetitive tasks away from the developer. It is possible to right-click on any variable, function, class, or file and choose from common. Below is an explanation of 3 of the most commonly used (there are many more options within the refactor menu!):

  • Rename: Rename the variable, function, class or file. This also updates all references in your code that uses the original name. This is extremely useful when working on large systems, where you aren’t entirely sure where all the references are.
  • Change Signature: Change the method signature. This is useful when changing existing methods, without breaking existing calls to the method. You can add and remove parameters safely so that your existing method calls do not break.
  • Move: Move the file. This is useful when moving individual files that contain classes, there references to which will be updated throughout your code.

Emmet Integration

Emmet is a popular plugin that allows the creation of complex HTML using an alternative, faster syntax. For example:

div#main>div.container>div.panel>div.panel-body>ul>li*5

Typing the above and pressing tab will produce:

<div id="main">
  <div class="container">
    <div class="panel">
      <div class="panel-body">
        <ul>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
        </ul>
      </div>
    </div>
  </div>
</div>
IDE