public function toString($indentationLevel)
 {
     $text = '';
     $text .= $this->message;
     if (!empty($this->detail)) {
         $text .= " ({$this->detail})";
     }
     if ($this->innerValidationResults !== null) {
         $text .= "\n";
         $text .= $this->innerValidationResults->toString($indentationLevel + 1);
     }
     return $text;
 }
示例#2
0
 /** 
  *		Restore check results from a JSON file.
  **/
 public static function unserialize($hash)
 {
     if (!USE_DB) {
         return null;
     }
     $directory = ThemeInfo::getReportDirectory($hash);
     if (!file_exists($directory)) {
         return null;
     }
     $history = new History();
     $themeInfo = $history->loadThemeFromHash($hash);
     if (empty($themeInfo)) {
         return null;
     }
     $fileValidator = new FileValidator($themeInfo);
     global $ExistingLangs;
     foreach ($ExistingLangs as $l) {
         $_validationResults = ValidationResults::unserialize($hash, $l);
         if (empty($_validationResults)) {
             continue;
         }
         $fileValidator->validationResults[$l] = $_validationResults;
     }
     if (!empty($themeInfo->parentId)) {
         $fewInfo = $history->getFewInfo($themeInfo->parentId);
         if (!empty($fewInfo["id"])) {
             $themeInfo->parentNameSanitized = $fewInfo["namesanitized"];
         }
         $themeInfo->parentThemeType = $fewInfo["themetype"];
     }
     if ($themeInfo->isThemeForest) {
         $fileValidator->generateThemeForestReport();
     }
     return $fileValidator;
 }