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 composer can streamline your workflow.
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.