Php Inspections (EA Extended)

Compatible with: IntelliJ IDEA PhpStorm
Feb 23, 2019
451 089
For support and donations please visit Github | Issues | PayPal | Patreon.

For status updates and release announcements please follow me at Twitter.

This plugin is a Static Code Analysis tool for PHP (aka inspections in JetBrains products).

It covers:
- architecture related issues
- weak types control and possible code construct simplifications
- performance issues
- non-optimal, duplicate and suspicious "if" conditions
- validation of magic methods usage
- regular expressions
- compatibility issues
- variety of time-consuming bugs
- PhpUnit API usage
- security issues

Some of inspections are expecting conditional statements (e.g. "if") to use group statement for wrapping body expressions. If this requirement is met then additional inspections are applied to the source code.

For Mac shortcuts, see this reference card. Windows/Linux ones are:
Alt + Shift + I to inspect current file with current profile
Ctrl + Alt + Shift + I to run inspection by name
Ctrl + Shift + F4 to close results of inspection.

On some projects CPU and therefore battery usage could be intensive, so it should be taken into account when traveling with a laptop.

Note: we are sending anonymous crash-reports to Google Analytics. You are welcome to review the implementation or disable the reporting in IDE settings.

A big thank you to our supporters: IntelliShop AG (Karlsruhe, Germany), Pixel & Tonic (Bend, USA) and OSS supporters on Patreon

Recent change notes

Stabilization release: bug-fixes. Supporters via Patreon are wanted.

- A constant can be used: resolved a false-positive (php_uname)
- Array and string offset validity: resolved false-positive (static/self)
- Cascading 'str_replace(...)' calls: quick-fix bug-fixes
- Foreach usage possible: quick-fix bug-fixes
- Inverted 'if-else' constructs: quick-fix bug-fixes
- Nested positive ifs: quick-fix bug-fixes
- Non-optimal regular expression: resolved a false-negative (i-modifier)
- Parameter/variable is not used: resolved a false-positive (assignment by reference)
- Statement could be decoupled from foreach: resolved false-positives (html-templating)
- Traits properties conflicts resolution: resolved a false-positive (phpdoc properties)
- 'empty(...)' usage: resolved false-positives (multiple cases)
- 'parent' keyword misused: resolved a false-positive (static functions)
- 'mkdir(...)' race condition: quick-fix bug-fixes
- *printf/*scanf arguments count mismatches: resolved a false-positive (pattern modifications)

- PhpUnit: bugs and best practices: new patterns
- 'array_push(...)' misused: added new settings