Lines
100.00%
2 / 2
Functions and Methods
100.00%
1 / 1
Classes and Traits
100.00%
1 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| RegistryNames | 100.00% | 2 / 2 | 100.00% | 1 / 1 | 1 | 100.00% | 1 / 1 | |||
| containsName | 100.00% | 2 / 2 | 100.00% | 1 / 1 | 1 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Stewart\Contracts\Registry; | |
| 6 | ||
| 7 | /** @internal */ | |
| 8 | final readonly class RegistryNames | |
| 9 | { | |
| 10 | public static function containsName(string $candidate, string ...$names): bool | |
| 11 | { | |
| 12 | $candidate = trim($candidate); | |
| 13 | ||
| 14 | return array_any($names, static fn(string $name): bool => strcasecmp($name, $candidate) === 0); | |
| 15 | } | |
| 16 | } |