You are here

function coder_postprocessor_indent_multiline_array in Coder 6.2

Same name and namespace in other branches
  1. 5.2 scripts/coder_format/coder_format.inc \coder_postprocessor_indent_multiline_array()
  2. 6 scripts/coder_format/coder_format.inc \coder_postprocessor_indent_multiline_array()

Related topics

File

scripts/coder_format/coder_format.inc, line 1284
Coder format helper functions.

Code

function coder_postprocessor_indent_multiline_array() {

  // Still buggy, disabled for now.
  return array(
    '#title' => 'Align equal signs of multiline array assignments in the same column.',
    '#search' => '@
      ^                   # match start of a line
      (?:\\s*              # require initial white-space
        (?:
          (?:
            ([\'"]).+?\\1  # capture a string key
            |.+?          # or any other key without white-space
          )
          \\s*=>\\s*        # require associative array arrow syntax
          .+?             # match an array value
          |\\),\\s?         # or a closing brace followed by a comma and a single optional white-space char
        )$                # require end of a line
      ){3,}               # require the pattern to match at least 3 times
      @mix',
  );
}