Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-3391

Support PSR-12 valid formatting rules

    XMLWordPrintableJSON

Details

    Description

      Please add options to allow for PSR-12 valid formatting. (PRS-12: https://www.php-fig.org/psr/psr-12/)

      Currently there is no way to get netbeans accept the following code format:
       

      $array = ['a','b','c'];
      foreach(
          array_filter($array, function ($a) {
              return $a === 'b';
          }) as $data
      ) {
          //code
      }
      

      Formatting the code removes the required indent:

      $array = ['a','b','c'];
      foreach(
      array_filter($array, function ($a) {
              return $a === 'b';
      }) as $data
      ) {
          //code
      }
      

      PSR-12 Rules:

      • PSR12.ControlStructures.ControlStructureSpacing.FirstExpressionLine
      • PSR12.ControlStructures.ControlStructureSpacing.LineIndent

      Attachments

        Issue Links

          Activity

            People

              junichi11 Junichi Yamamoto
              Bohninger Johannes
              Votes:
              4 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h
                  1h