Files
ik-codex/src/Detective/DetectorInterface.php
indifferentketchup 66a2fcc5f3 Rename namespace Aternos\Codex to IndifferentKetchup\Codex
Bulk substitution across all PHP files in src/ and test/. Covers
namespace declarations, use statements, fully-qualified class
references, and @package PHPDoc tags. No logic changes.
2026-04-30 15:13:52 +00:00

38 lines
1.0 KiB
PHP

<?php
namespace IndifferentKetchup\Codex\Detective;
use IndifferentKetchup\Codex\Log\File\LogFileInterface;
/**
* Interface DetectorInterface
*
* @package IndifferentKetchup\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;
}