Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| AcceptSpecificity | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | declare(strict_types=1); |
| 3 | /** |
| 4 | * Pop PHP Framework (https://www.popphp.org/) |
| 5 | * |
| 6 | * @link https://github.com/popphp/popphp-framework |
| 7 | * @author Nick Sagona, III <nick@popphp.org> |
| 8 | * @copyright Copyright (c) 2009-2026 Nick Sagona, III |
| 9 | * @license https://www.popphp.org/license New BSD License |
| 10 | */ |
| 11 | |
| 12 | /** |
| 13 | * @namespace |
| 14 | */ |
| 15 | namespace Pop\Http\Server; |
| 16 | |
| 17 | /** |
| 18 | * HTTP accept specificity enum |
| 19 | * |
| 20 | * Controls how strict an AcceptHeader/Server\Request match must be. Maps directly onto |
| 21 | * AcceptHeader::matches()'s internal per-entry specificity tiers (exact type/subtype match = 2, |
| 22 | * a subtype wildcard = 1, a bare full wildcard = 0) - the enum's backing value IS that threshold, |
| 23 | * so enforcing a minimum is a direct integer comparison, no translation table needed. |
| 24 | * |
| 25 | * @category Pop |
| 26 | * @package Pop\Http |
| 27 | * @author Nick Sagona, III <nick@popphp.org> |
| 28 | * @copyright Copyright (c) 2009-2026 Nick Sagona, III |
| 29 | * @license https://www.popphp.org/license New BSD License |
| 30 | * @version 6.0.0 |
| 31 | */ |
| 32 | enum AcceptSpecificity: int |
| 33 | { |
| 34 | |
| 35 | /** |
| 36 | * A bare full wildcard entry (any type, any subtype) may satisfy the match - default, today's behavior |
| 37 | */ |
| 38 | case Any = 0; |
| 39 | |
| 40 | /** |
| 41 | * A subtype wildcard or an exact type/subtype match satisfies; a bare full wildcard entry does not |
| 42 | */ |
| 43 | case Loose = 1; |
| 44 | |
| 45 | /** |
| 46 | * Only a literal type/subtype match satisfies |
| 47 | */ |
| 48 | case Exact = 2; |
| 49 | |
| 50 | } |