You are here

function coder_postprocessor_multiple_vars in Coder 6.2

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

Related topics

File

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

Code

function coder_postprocessor_multiple_vars() {
  return array(
    '#title' => 'Align equal signs of multiple variable assignments in the same column.',
    '#search' => '@
      ^(          # match start of a line
        \\n?\\ *    # match white-space, but only one new line
        \\$.+?     # match a variable name
        \\ =\\      # match a variable assignment
        .+?$      # match a variable value
      ){3,}       # require the pattern to match at least 3 times
      @mx',
    '#replace_callback' => 'coder_replace_multiple_vars',
  );
}