APIExplorer::formatDocBlock() - Make public. Normalize whitespace.
[civicrm-core.git] / CRM / Admin / Page / APIExplorer.php
index 6097d5831a3f895ca037361ae0429e5e482501b5..c5bfa84a05a36fee6fd4d0b0e398b77c19e22007 100644 (file)
@@ -184,7 +184,12 @@ class CRM_Admin_Page_APIExplorer extends CRM_Core_Page {
    * @param string $text
    * @return string
    */
-  private static function formatDocBlock($text) {
+  public static function formatDocBlock($text) {
+    // Normalize #leading spaces.
+    $lines = explode("\n", $text);
+    $lines = preg_replace('/^ +\*/', ' *', $lines);
+    $text = implode("\n", $lines);
+
     // Get rid of comment stars
     $text = str_replace(array("\n * ", "\n *\n", "\n */\n", "/**\n"), array("\n", "\n\n", '', ''), $text);