Completed
Push — master ( 297d81...f5b8f3 )
by Alexandr
01:26
created

ArrHelper::isStrKeysArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Bricks\Helper;
4
5
6
class ArrHelper
7
{
8
    /**
9
     * @param array $array
10
     * @return bool
11
     */
12
    public static function isStrKeysArray(array $array): bool
13
    {
14 9
        $filtered = array_filter($array, function ($key) {
15 8
            return !is_string($key);
16 9
        }, ARRAY_FILTER_USE_KEY);
17
18 9
        return empty($filtered);
19
    }
20
}