Php Inspections (EA Extended)

Compatible with: IntelliJ IDEA PhpStorm
Jan 19, 2018
236 354
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.

Note: we are sending anonymous crash-reports and installation statistics to Google Analytics. You are welcome to review the implementation.

Download plugin

Recent change notes

Bug-fixes. BTW, it would be awesome to get more supporters on Patreon.

- Worked out crash reports for January
- Worked out regressions in PhpStorm 2017.3

- Callable parameter usage violates definition: resolved false-positives (multiple cases around static type)
- Foreach source to iterate over: added new settings
- Foreach usage possible: resolved false-positives (strings iteration)
- Missing or empty conditionals group statement: bug-fix (doc-block breaks analysis)
- Null reference: resolved false-positives (beberlei/assert assertions)
- One-time use variables:new added new settings
- PhpUnit: bugs and best practices: resolved false-positives (multiple cases)
- Return type hint can be used: resolved false-positives (multiple cases)
- Unnecessary call arguments specification: resolved false-positives (magic constants)
- Unnecessary parentheses: resolved false-positives (multiple cases)
- Unused constructor dependencies: resolved false-positives (multiple cases)
- 'get_class(...)' usage correctness: invoke with language level 7.1+
- 'mkdir(...)' race condition: QF bug-fix (arguments gets lost)

- Fixed-time string starts with checks: implemented (needs activation)
- Inverted 'if-else' constructs: new patterns
- PhpUnit: bugs and best practices: new patterns
- 'get_class(...)' usage correctness: new patterns