44 lines
858 B
PHP
44 lines
858 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Classifier\Lib\Discriminant;
|
|
|
|
class AnalyzeResult
|
|
{
|
|
// FIXME : php8.1 readonly props
|
|
|
|
/** @var float */
|
|
public $score;
|
|
|
|
/** @var float */
|
|
public $rawScore;
|
|
|
|
/** @var bool */
|
|
public $isAlert;
|
|
|
|
/** @var bool */
|
|
public $isBlacklisted;
|
|
|
|
/** @var string */
|
|
public $reason;
|
|
|
|
/** @var string[] */
|
|
public $keywordsFound;
|
|
|
|
public function __construct(
|
|
float $score,
|
|
float $rawScore,
|
|
bool $isAlert,
|
|
bool $isBlacklisted = false,
|
|
string $reason = '',
|
|
array $keywordsFound = []
|
|
) {
|
|
$this->score = $score;
|
|
$this->rawScore = $rawScore;
|
|
$this->isAlert = $isAlert;
|
|
$this->isBlacklisted = $isBlacklisted;
|
|
$this->reason = $reason;
|
|
$this->keywordsFound = $keywordsFound;
|
|
}
|
|
}
|