PhpStorm
 
Get PhpStorm
You are viewing the documentation for an earlier version of PhpStorm.

Code Inspection: 'switch' with common parts

Last modified: 16 May 2022

Reports the 'switch' statements with duplicated common parts.

In the following example, all branches of the switch statement contain the common echo $message statement. After the quick-fix is applied, this statement extracted from the switch statement.