Passed
Push — master ( df9f47...bd3ab4 )
by Yaroslav
01:28
created

StrHelper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 10
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A implodeFiltered() 0 7 2
1
<?php
2
3
namespace Angecode\LaravelFullName;
4
5
class StrHelper
6
{
7 3
    public static function implodeFiltered(array $items, string $glue = ' ', callable $callback = null)
8
    {
9 3
        return implode(
10 3
            $glue,
11 3
            ($callback) ? array_filter($items, $callback) : array_filter($items)
12
        );
13
    }
14
}
15