Inspectopedia Help

Inconsistent return points

Reports inconsistencies in function/method exit points.

The following types of inconsistencies are reported:

  • The function/method contains the return statements both with and without arguments.

  • The function/method may return a value or otherwise end its execution without returning anything.

Technically these are not errors, but practically they usually indicate a programming mistake.

Inspection options

Option

Type

Default

Treat 'return null' and 'return' same way in 'void' functions/methods

Checkbox

true

Inspection Details

Available in:

PhpStorm 2023.3, Qodana for PHP 2023.3

Plugin:

PHP, 233.SNAPSHOT

Last modified: 13 July 2023