Completed
Push — master ( 897757...1cf9f7 )
by Paweł
18s queued 10s
created

ArrayHelper   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A sortNestedArrayAssocAlphabeticallyByKey() 0 11 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SWP\Component\Common;
6
7
class ArrayHelper
8
{
9
    public static function sortNestedArrayAssocAlphabeticallyByKey(array $a): array
10
    {
11
        ksort($a);
12
        foreach ($a as $key => $value) {
13
            if (is_array($value)) {
14
                $a[$key] = self::sortNestedArrayAssocAlphabeticallyByKey($value);
15
            }
16
        }
17
18
        return $a;
19
    }
20
}
21