1<?php
2
3// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
4// SPDX-License-Identifier: BSD-3-Clause
5
6declare(strict_types=1);
7
8namespace SimplePie\Cache;
9
10/**
11 * Interface for creating a cache filename
12 */
13interface NameFilter
14{
15 /**
16 * Method to create cache filename with.
17 *
18 * The returning name MUST follow the rules for keys in PSR-16.
19 *
20 * @link https://www.php-fig.org/psr/psr-16/
21 *
22 * The returning name MUST be a string of at least one character
23 * that uniquely identifies a cached item, MUST only contain the
24 * characters A-Z, a-z, 0-9, _, and . in any order in UTF-8 encoding
25 * and MUST not longer then 64 characters. The following characters
26 * are reserved for future extensions and MUST NOT be used: {}()/\@:
27 *
28 * A provided implementing library MAY support additional characters
29 * and encodings or longer lengths, but MUST support at least that
30 * minimum.
31 *
32 * @param string $name The name for the cache will be most likely an url with query string
33 *
34 * @return string the new cache name
35 */
36 public function filter(string $name): string;
37}
38