Files
newznab-tmux/app/Services/Categorization/Categorizers/AbstractCategorizer.php
T
2025-12-09 17:03:43 +01:00

17 lines
801 B
PHP

<?php
namespace App\Services\Categorization\Categorizers;
use App\Services\Categorization\CategorizationResult;
use App\Services\Categorization\Contracts\CategorizerInterface;
use App\Services\Categorization\ReleaseContext;
abstract class AbstractCategorizer implements CategorizerInterface
{
protected int $priority = 50;
public function getPriority(): int { return $this->priority; }
public function shouldSkip(ReleaseContext $context): bool { return false; }
protected function matched(int $categoryId, float $confidence, string $matchedBy, array $debug = []): CategorizationResult
{
return new CategorizationResult($categoryId, $confidence, $matchedBy, $debug);
}
protected function noMatch(): CategorizationResult { return CategorizationResult::noMatch(); }
}