Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
1 / 1
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3declare(strict_types=1);
4
5/** @license For full copyright and license information, please see the LICENSE.md file. */
6
7namespace App\Core\Api\Domain\Repository;
8
9defined('AMMONLY_APP') || exit('Direct script access is forbidden.');
10
11use App\Core\Api\Domain\Model\ApiKey;
12
13/**
14 * API Key Domain Repository Interface.
15 *
16 * Defines contracts for loading and auditing API client keys.
17 *
18 * @package App\Core\Api\Domain\Repository
19 */
20interface ApiKeyRepositoryInterface
21{
22    /**
23     * Finds active API key matching raw bearer token.
24     *
25     * @param string $rawToken Bearer token from request.
26     * @return ApiKey|null Found valid API key entity or null.
27     */
28    public function findByToken(string $rawToken): ?ApiKey;
29
30    /**
31     * Records timestamp of successful API key usage.
32     *
33     * @param int $id API key primary identifier.
34     * @return void
35     */
36    public function touchLastUsed(int $id): void;
37}