This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 255820

Summary: Add option to control blank lines between cases in switch statement
Product: php Reporter: SebastianZ
Component: Formatting & IndentationAssignee: Ondrej Brejla <obrejla>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.1   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description SebastianZ 2015-10-09 06:55:50 UTC
There should be an option in Tools > Options > Editor > Formatting > PHP > Blank Lines that controls the number of blank lines between case and default blocks within switch statements.

So this:

switch($var) {
  case 0:
    echo 'foo';


  case 1:
    echo 'bar';
  default:
    echo 'baz';
}

with having the formatter set to 1 line between cases gets formatted as:

switch($var) {
  case 0:
    echo 'foo';

  case 1:
    echo 'bar';

  default:
    echo 'baz';
}

Sebastian