Php Inspections (EA Extended)

Compatible with: IntelliJ IDEA PhpStorm
Nov 12, 2017
246 800
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
- validation of exception handling workflow
- 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.

Download plugin

Recent change notes

Bug-fix release:

- Fixed multiple exceptions cases

- Class overrides a field of a parent class: resolved false-positives (doctrine annotations)
- Exceptions handling and annotating: QF bug-fix
- Foreach source to iterate over: resolved false-positives (multiple cases)
- Non-optimal if conditions: resolved false-positives (multiple cases)
- Non-optimal regular expression: resolved false-positives (wrongly suggested trim usage)
- Null reference: resolved a false-positive (complex if-conditions)
- Parameter/variable is not used: resolved false-positives (assignments as calls argument)
- Statement could be decoupled from foreach: resolved false-positives (possible objects modification)
- Static methods invocation via '->': resolved false-positives (method name starts with 'static')
- 'isset(...)' usage: resolved false-positives (isset in finally-statements)
- 'simplexml_load_file(...)' usage correctness: QF bug-fix
- *printf/*scanf arguments count mismatches: resolved false-positives (sscanf as call argument)

- Access modifiers shall be defined: new patterns (thank you David Rodrigues)
- Default value is hidden in else branch: QF implemented
- Security advisories for Composer packages: QF implemented
- Ternary operator could be simplified: new patterns
- Unqualified function/constant reference: added settings, default behaviour changed
- 'in_array(...)' misused: added QF settings