PhpStorm - SonarLint Plugin

Daniel Opitz
Daniel Opitz
01 Dec 2019

I’m sure you’ve heard of phpstan, psalm, and the PhpStorm Php Inspections (EA Extended) plugin. Maybe you’re already using one of these great tools to scan your codebase for issues and possible bugs. But this time I want to show you another very cool static code analyzer for PHP:

The SonarLint Plugin for PhpStorm.

SonarLint is an IDE extension that helps you detect and fix quality issues as you write code. Like a spell checker, SonarLint squiggles flaws so they can be fixed before committing code. You can get it directly from the IntelliJ IDEA Plugin Repository, and it will then detect new bugs and quality issues as you code (PHP, Java, Kotlin, Ruby, JavaScript and Python).

If your project is analyzed on SonarQube or on SonarCloud, SonarLint can connect to the server to retrieve the appropriate quality profiles and settings for that project.

Installation

Configuration

Usage

To start the code analysis…

As soon as the scan is completed, you should see the result of the code inspection:

image