mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 17:28:55 +00:00
38 lines
942 B
PHP
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();
|
|
}
|
|
}
|