Initial import from aternosorg/codex-minecraft
Some checks failed
Tests / Run tests on PHP v8.4 (push) Failing after 32s
Tests / Run tests on PHP v8.5 (push) Failing after 2s

This commit is contained in:
2026-04-30 09:56:57 -05:00
commit 7c7fe5ca80
94 changed files with 7003 additions and 0 deletions

View File

@@ -0,0 +1,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;
}