TShorterKey   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A shorterKey() 0 4 1
1
<?php
2
3
namespace kalanis\kw_forms\Controls;
4
5
6
/**
7
 * Trait TShorterKey
8
 * @package kalanis\kw_forms\Controls
9
 * When you want access key without that array component - just basic key name
10
 */
11
trait TShorterKey
12
{
13 4
    protected function shorterKey(string $currentKey): string
14
    {
15 4
        $pre = explode('[', $currentKey);
16 4
        return strval(reset($pre));
17
    }
18
}
19