Total Complexity | 4 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Coverage | 87.5% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
8 | trait ClassMethodMap |
||
9 | { |
||
10 | 26 | protected static function classInMap($specification): bool |
|
11 | { |
||
12 | 26 | if (!\is_object($specification)) { |
|
13 | return false; |
||
14 | } |
||
15 | |||
16 | 26 | return \array_key_exists(\get_class($specification), static::classMethodMap()); |
|
17 | } |
||
18 | |||
19 | 66 | protected static function methodFor(object $specification): string |
|
20 | { |
||
21 | 66 | return static::classMethodMap()[\get_class($specification)]; |
|
22 | } |
||
23 | |||
24 | /** |
||
25 | * @return array<string, string> |
||
26 | */ |
||
27 | abstract protected static function classMethodMap(): array; |
||
28 | |||
29 | 26 | protected function supportsSpecification($specification): bool |
|
32 | } |
||
33 | } |
||
34 |