StopwordRepositoryInterface.php

Code Hygiene Score: 100

Keine Issues gefunden.

Klassen 1

Funktionen 9

Verwendet von 5

Versionen 1

Code

<?php

declare(strict_types=1);

namespace Domain\Repository;

// @responsibility: Interface für Stopword-Persistenz (Entity-Extraction Filter)

interface StopwordRepositoryInterface
{
    /**
     * Find all stopwords with optional filtering.
     *
     * @return array<int, array<string, mixed>>
     */
    public function findAll(bool $activeOnly = true, ?string $category = null): array;

    /**
     * Find stopword by ID.
     *
     * @return array<string, mixed>|null
     */
    public function find(int $id): ?array;

    /**
     * Get all canonical forms for fast lookup.
     *
     * @return array<string> List of canonical stopword forms
     */
    public function getCanonicalForms(bool $activeOnly = true): array;

    /**
     * Check if a word is a stopword.
     */
    public function isStopword(string $word): bool;

    /**
     * Create a new stopword.
     *
     * @param array<string, mixed> $data
     */
    public function create(array $data): int;

    /**
     * Update a stopword.
     *
     * @param array<string, mixed> $data
     */
    public function update(int $id, array $data): bool;

    /**
     * Delete a stopword.
     */
    public function delete(int $id): bool;

    /**
     * Toggle active status.
     */
    public function toggleActive(int $id): bool;

    /**
     * Get statistics by category.
     *
     * @return array{total: int, active: int, by_category: array<string, array{count: int, active: int}>}
     */
    public function getStats(): array;
}
← Übersicht Graph