Exemple #1
0
 /**
 	Parse docComments to retrieve the comment and the modifiers.
 
 	@param $sDocComment The docComment.
 	@param $aParsedData Array where the parsed data is saved.
 */
 protected function parseDocComment($sDocComment, &$aParsedData)
 {
     $aParsedData = array();
     // Whether there is stars on each line
     // This docComment format is only scarcely supported for now
     $bHasStars = preg_match('/^[[:space:]]*\\*/', $sDocComment) != 0;
     $a = explode("\n", $sDocComment);
     $sDocComment = null;
     foreach ($a as $sLine) {
         if (empty($sLine) || $sLine[0] != '@' || ($sLine[1] == ' ' || $sLine[1] == "\t")) {
             if ($bHasStars && strpos($sLine, '@') === false) {
                 // Leave stars if it's a @modifier to have a bullet list
                 $sLine = substr($sLine, strpos($sLine, '*') + 1);
             }
             $sDocComment .= $sLine . "\n";
         } else {
             $sLine = substr($sLine, 1);
             $a = preg_split('/\\s+/', $sLine, 2);
             $sFunc = 'parseDocComment' . ucwords($a[0]);
             $sLine = isset($a[1]) ? $a[1] : '';
             if (is_callable(array($this, $sFunc))) {
                 $this->{$sFunc}($sLine, $aParsedData);
             } else {
                 weeLog(sprintf(_WT('Skipping Unknown doc comment modifier "%s".'), $a[0]));
             }
         }
     }
     $aParsedData['comment'] = trim($sDocComment);
 }
Exemple #2
0
<?php

weeLog('An error happened!', 'error');
Exemple #3
0
<?php

weeLog('Sending a message to the log file!');