You are here

function coder_postprocessor_multiple_vars in Coder 5

Same name and namespace in other branches
  1. 5.2 scripts/coder_format/coder_format.inc \coder_postprocessor_multiple_vars()
  2. 6.2 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 889

Code

function coder_postprocessor_multiple_vars() {

  // @todo Prevent matching of multiple lines separated by a blank line 26/03/2007 sun
  return array(
    '#title' => 'Align equal signs of multiple variable assignments in the same column.',
    // \s* matches whitespace including new lines
    // \$.+? matches variable names
    // {3,} requires the pattern to match at least 3 times
    '#search' => '/^(\\s*\\$.+? = .+?$){3,}/m',
    '#replace_callback' => 'coder_replace_multiple_vars',
  );
}