Files
newznab-tmux/app/Services/Categorization/Categorizers/AbstractCategorizer.php
T
2026-02-26 14:26:07 +01:00

38 lines
942 B
PHP

<?php
declare(strict_types=1);
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;
}
/**
* @param array<string, mixed> $debug
*/
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();
}
}