Getting started with PHP in PhpStorm

Focus on writing quality code while PhpStorm’s automated tools handle mundane tasks. In this episode, we explore how PhpStorm's robust autocompletion, automatic class importing, error detection capabilities, navigation shortcuts, and support for different PHP versions and composers can streamline your workflow.

Transcript

Chances are that if you’re using PhpStorm, you’re writing PHP code. You’ll soon notice that PhpStorm will do a lot of work for you without you having to learn any keyboard shortcuts or actions.

Autocompletion

First, you’ll notice that PhpStorm will frequently autocomplete your code. It has a deep understanding of your codebase and often suggests what to write next: method names, variables, functions, parameters, whole blobs of code, class names, and much more.

Speaking of classes, PhpStorm knows about autoloading, so if you reference a class for the first time within a file, PhpStorm will automatically import it.

Moving classes

If, at a later point, you decide to move this class to another place, then PhpStorm will make sure all references to it are updated correctly. It will also update the original class namespace for you so that you don’t have to worry about such boring details. Instead, you’ll be able to be as productive as possible and focus on what really matters – your code.

Error detection

Another part of PhpStorm’s deep knowledge is error detection. It’ll tell you what’s missing or deprecated, perform extensive type checking, and it knows a thing or two about PHP’s quirks as well.

Navigation

Next, you can navigate within your codebase between class definitions, function declarations, or variables. Do this by holding Control or Command, then click wherever you want to go.

Composer support

Finally, PhpStorm also has composer support and works with different PHP versions.

We’ll dive deeper into many of these topics in other videos in this series, but remember that you don’t need to learn everything to get PhpStorm to help you. The IDE will do the heavy lifting for you as you’re writing your code.