Completed
Push — master ( b035c8...ddcf44 )
by Paweł
02:10
created

IsAssoc::isAssoc()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 3

Importance

Changes 0
Metric Value
cc 3
nc 3
nop 1
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
ccs 5
cts 5
cp 1
crap 3
1
<?php
2
declare(strict_types=1);
3
4
namespace Wszetko\Sitemap\Traits;
5
6
trait IsAssoc
7
{
8
    /**
9
     * @param array $array
10
     *
11
     * @return bool
12
     */
13 1
    private function isAssoc(array $array): bool
14
    {
15 1
        foreach ($array as $key => $val) {
16 1
            if (!is_integer($key)) {
17 1
                return true;
18
            }
19
        }
20
21 1
        return false;
22
    }
23
}