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

IsAssoc   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 10
c 0
b 0
f 0
ccs 5
cts 5
cp 1
wmc 3
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A isAssoc() 0 10 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
}