Php Inspections (EA Extended)

Compatible with: IntelliJ IDEA PhpStorm
180 181
For support and donations please visit Github | Issues | PayPal.

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

Hot-fix release; you can now support us via Patreon

+ Callable parameter usage violates definition: resolved false-positives (annotated properties)
+ Declaration access can be weaker: resolved false-positives (protected methods used by parent classes)
+ Foreach source to iterate over: resolved false-positives (predefined _* variables)
- Non-optimal if conditions: resolved false-positives (comparing to booleans), added options
- Parameter/variable is not used: resolved false-positives
- Senseless proxy function: resolved false-positives (return type changed)
- Summer-time unsafe date manipulations: resolved false-positives (context aware now)
- Suspicious assignments: resolved false-positives (assignment by reference)
- Too many parameters in a callable: resolved false-positives (UTs context)
+ Unnecessary arguments specification: resolved false-positives (in_array, array_search)
- 'isset(...)' usage: resolved false-positives (global context)
- ::class can be used: resolved false-positives (language level considered)

- Callable calls in loops termination condition: QF implemented (thank you @rentalhost)
- Class overrides a field of a parent class: new patterns
- Class property initialization flaws: new patterns
- If-return-return could be simplified: QF bug-fix (condition parts were lost)
- Isset operations variables existence: new patterns
- Null reference: new patterns
- Parameter/variable is not used: new patterns
- Suspicious binary operations: new patterns
- Class violates singleton/factory pattern definition: dropped
- Private constructor semantics: dropped
- 'count(...)' calls on Propel collection: dropped

- Declaration access can be weaker: implemented (thank you @rentalhost)
- Mocking correctness: implemented
- Passing arguments by reference correctness: implemented
+ PSR-compliant modifiers order: implemented
- Unnecessary arguments specification: implemented (thank you @rentalhost)
- 'scandir(...)' low performing usage: implemented
- ::class constant usage correctness: implemented