Php Inspections (EA Extended)

Compatible with: IntelliJ IDEA PhpStorm
Sep 19, 2018
349 067
For support and donations please visit Github | Issues | PayPal | Patreon.

Please follow me at twitter for status updates.

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.

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

Download plugin

Recent change notes

Hot-fix release. Supporters via Patreon are wanted.

- Callable parameter usage violates definition: resolved a false-positive (is_numeric)
- Class mocking correctness: resolved a false-positive (mocking interface)
- Nested positive ifs: QF bug-fix
- PhpUnit: bugs and best practices: resolved false-positives (multiple cases)
- Static methods invocation via '->': resolved false-positives (parameters and used variables)
- Suspicious ternary operator: resolved a false-positive (spaceship operator)
- Unqualified function/constant reference: bug-fix (non-opcoded functions were reported)
- Variable functions usage: resolved a false-positive (a case with invocation arguments)
- ::class can be used: QF bug-fix (add imports after strict types declaration)
- 'gettype(...)' could be replaced with 'is_*(...)': resolved a false-positive (`resource (closed)` type)
- 'in_array(...)', 'array_search(...)' type unsafe usage: QF bug-fix (NS specification gets lost)
- 'mkdir(...)' race condition: resolved a false-positive (`... or die()` constructs)
- 'substr(...)' could be replaced with 'strpos(...)': resolved a false-positive (array element accesses)