Passed
Branch master (3f21c4)
by Dawid
02:17
created

AssertUtils   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getNonStrings() 0 12 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiechu\SymfonyCommonsBundle\Utils;
6
7
class AssertUtils
8
{
9
    /**
10
     * @param iterable|string[] $elements
11
     *
12
     * @return string[]
13
     */
14 1
    public static function getNonStrings(iterable $elements): array
15
    {
16 1
        $nonStrings = [];
17
18 1
        foreach ($elements as $string) {
19 1
            if (!is_string($string)) {
20 1
                $nonStrings[] = $string;
21
            }
22
        }
23
24 1
        return $nonStrings;
25
    }
26
}
27