-
Notifications
You must be signed in to change notification settings - Fork 2
/
DetectorInterface.php
38 lines (34 loc) · 1 KB
/
DetectorInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace Aternos\Codex\Detective;
use Aternos\Codex\Log\File\LogFileInterface;
/**
* Interface DetectorInterface
*
* @package Aternos\Codex\Detective
*/
interface DetectorInterface
{
/**
* Set the log file
*
* @param LogFileInterface $logFile
* @return $this
*/
public function setLogFile(LogFileInterface $logFile): static;
/**
* Detect if the log matches
*
* Return true to directly force the detective to accept your result without considering any other detector
* Return false to force the detective to never use your result
* Return a number between 0 and 1 as probability for this detector
* Possible algorithm to get this number would be (matching lines) / (total lines)
*
* The detective decides which detector wins (and which related log class to use) in this order:
* return === true
* highest return
* default log
*
* @return bool|float
*/
public function detect(): float|bool;
}