Esempio n. 1
0
 /**
  * Stores a result in the state system.
  *
  * @param \Drupal\security_review\CheckResult $result
  *   The result to store.
  */
 public function storeResult(CheckResult $result = NULL)
 {
     if ($result == NULL) {
         $context = array('!reviewcheck' => $this->getTitle(), '!namespace' => $this->getNamespace());
         SecurityReview::log($this, 'Unable to store check !reviewcheck for !namespace', $context, RfcLogLevel::CRITICAL);
         return;
     }
     $findings = $this->storesFindings() ? $result->findings() : array();
     Drupal::state()->setMultiple(array($this->statePrefix . 'last_result.result' => $result->result(), $this->statePrefix . 'last_result.time' => $result->time(), $this->statePrefix . 'last_result.findings' => $findings));
 }