You are here

function coder_format_string_all in Coder 7.2

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

Formats source code according to Drupal conventions, also using post and pre-processors.

Parameters

$code Code to process.:

3 calls to coder_format_string_all()
CoderTestCase::assertFormat in scripts/coder_format/tests/CoderTestCase.php
CoderTestFile::test in scripts/coder_format/tests/CoderTestFile.php
Implements SimpleExpectation::test().
coder_format_file in scripts/coder_format/coder_format.inc
Reads, backups, processes and writes the source code from and to a file.

File

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

Code

function coder_format_string_all($code) {

  // Preprocess source code.
  $code = coder_exec_processors($code, 'coder_preprocessor');

  // Process source code.
  $code = coder_format_string($code);

  // Postprocess source code.
  $code = coder_exec_processors($code, 'coder_postprocessor');

  // Fix beginning and end of code.
  $code = coder_trim_php($code);
  return $code;
}