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

PHP named argument indentation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 12.5, 12.6
    • None
    • php - Editor
    • None

    Description

      Hi,

      Netbeans does not align code with named Arguments (php8.x) correctly

      class Foo
      {    public static function m1(string $arg1, string $arg2): void
          {
          }
      }
      class Test
      {
          function badIndentation(): void
          {
              Foo::m1(
                  arg1: self::create($this->create('ni')),
                                                   arg2: 'something'
              );
          }
          public function create(string $test): string
          {
              return $test;
          }
      }
      

      Note the "arg2" line to the far right, aligned with the create function.
      arg1: and arg2: must have the same alignment.

      I checked my formatting preferences, i can't find something strange.

      I addition, is there a way to have a PSR-12 compliant formatting option without manually changing Netbeans preferences ?

      Thanks

      Attachments

        Activity

          People

            junichi11 Junichi Yamamoto
            FFT Jayce
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: