Php Inspections (EA Extended)

Compatible with: IntelliJ IDEA PhpStorm
Oct 18, 2017
230 231
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

Performance optimization, bug-fixes and new inspections:

- Fixed exceptions in PhpStorm EAP-versions
- Cascading dirname(...) calls: resolved false-positives (QFed code gets reported)
- Could be replaced with '(array) ...': QF bug-fix
- Null reference: resolved false-positives (multiple cases)
- Unnecessary call arguments specification: resolved false-positives (extra arguments)
- Unnecessary parentheses: resolved false-positives (concatenation)
- Security advisories for Composer packages: resolved false-positives (library type is implicitly declared)
- Self class referencing: resolved false-positives (multiple cases)
- Variable functions usage: resolved false-positives (`string`->method(...))
- 'mkdir(...)' race condition: QF bug-fix

- A constant can be used: new patterns
- Forgotten debug statements: more debug functions (XDebug, typo3, Drupal, doctrine)
- General '\Exception' is thrown: added settings
- If-return-return could be simplified: new patterns
- Missing or empty conditionals group statement: added settings
- Non-optimal if conditions: new patterns
- Non-optimal regular expression: new patterns
- Suspicious binary operations: new patterns

- Missing or empty conditionals group statement: QF implemented
- Nested positive ifs: QF implemented
- RSA oracle padding vulnerability: implemented
- Unnecessary 'date(...)' arguments specification: implemented
- Unnecessary isset arguments specification: implemented
- 'compact(...)' can be used: implemented