mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-01-17 03:04:47 -05:00
40 lines
907 B
PHP
40 lines
907 B
PHP
<?php
|
|
|
|
namespace Gazelle;
|
|
|
|
class LogfileSummary {
|
|
protected $list;
|
|
protected $allChecksum;
|
|
protected $lowestScore;
|
|
|
|
public function __construct() {
|
|
$this->list = [];
|
|
}
|
|
|
|
public function add (Logfile $log) {
|
|
$this->list[] = $log;
|
|
$this->allChecksum = is_null($this->allChecksum)
|
|
? $this->allChecksum
|
|
: $this->allChecksum && $log->checksum();
|
|
$this->lowestScore = is_null($this->lowestScore)
|
|
? $this->lowestScore
|
|
: min($this->lowestScore, $log->score());
|
|
}
|
|
|
|
public function checksumStatus () {
|
|
return $this->allChecksum ? '1' : '0';
|
|
}
|
|
|
|
public function overallScore () {
|
|
return is_null($this->lowestScore) ? 0 : $this->lowestScore;
|
|
}
|
|
|
|
public function all() {
|
|
return $this->list;
|
|
}
|
|
|
|
public function count() {
|
|
return count($this->list);
|
|
}
|
|
}
|