コード例 #1
0
ファイル: paSfProject.class.php プロジェクト: rafal2208/blues
 /**
  * Check and process the alerts specific to the project.
  */
 protected function processFinalAlert()
 {
     // Add the alert summary
     if ($this->hasAlerts()) {
         $html = '';
         $countAlerts = $this->countAlerts();
         $maxAlertStatus = paAlert::INFO;
         foreach ($this->getAlertsSummary() as $status => $count) {
             if ($count > 0) {
                 if ($status < $maxAlertStatus) {
                     $maxAlertStatus = $status;
                 }
                 $html .= sprintf(' &raquo; %d %s(S)<br/>', $count, paAlert::getStatusLabel($status));
             }
         }
         $alert = new paAlert(paAlert::ALERT_PROJECT_ANALYSIS_NOK, $maxAlertStatus, sprintf('The project has "%d" alert(s) according to the coding standards of the "%s" configuration:<br/>' . $html, $countAlerts, $this->getConfigName()));
     } else {
         $alert = new paAlert(paAlert::ALERT_PROJECT_ANALYSIS_OK, paAlert::INFO, sprintf('Congratulations ! The project "%s" respects the symfony coding standards of the "%s" configuration.', $this->getName(), $this->getConfigName()));
     }
     $this->addAlert($alert);
 }