You are here

function _coder_postprocessor_array_rearrange in Coder 7

Same name and namespace in other branches
  1. 7.2 scripts/coder_format/coder_format.inc \_coder_postprocessor_array_rearrange()

Related topics

File

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

Code

function _coder_postprocessor_array_rearrange() {
  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',
  );
}