You are here

function coder_postprocessor_array_rearrange in Coder 5

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

Related topics

File

scripts/coder_format/coder_format.inc, line 932

Code

function coder_postprocessor_array_rearrange() {

  // @bug common.inc, comment.module:1506->1519, comment.module:1525->1550,
  //   user.module:913->934
  // not yet working properly 25/03/2007 sun
  return array(
    '#title' => 'Break array elements into separate lines, indented one level.',
    // ([\040\t]*) matches blanks and tabs
    // (.*?array\() matches anything and 'array('
    // ((.+ => .+, ){3,}) matches all array items, except the last one
    // (.+ => ([^\(\)]+)) matches the last array item, excluding
    //   arrays or functions (starting with a left parenthesis) [not supported yet]

    #'#search' => '/^([\040\t]*)(.*?array\()((.+ => .+, ){3,})(.+ => ([^\(\)]+))\)/m',
    '#replace_callback' => 'coder_replace_array_rearrange',
  );
}