Mappings   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 15
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A string() 0 9 2
1
<?php
2
3
namespace PhpWinTools\WmiScripting\MappingStrings;
4
5
abstract class Mappings
6
{
7
    const STRING_ARRAY_CONSTANT_NAME = 'STRING_ARRAY';
8
9
    const STRING_ARRAY = [];
10
11
    public static function string(string $constant): string
12
    {
13
        $string_constant = static::STRING_ARRAY_CONSTANT_NAME;
14
15
        if (array_key_exists($constant, constant(get_called_class() . "::{$string_constant}"))) {
16
            return constant(get_called_class() . "::{$string_constant}")[$constant];
17
        }
18
19
        return '';
20
    }
21
}
22