Passed
Push — master ( 8989ad...df9f47 )
by Yaroslav
02:00 queued 29s
created

StrHelper::concatIfNotEmpty()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Angecode\LaravelFullName;
4
5
class StrHelper
6
{
7 2
    public static function concatIfNotEmpty(array $items, string $glue = ' ')
8
    {
9 2
        return implode(
10 2
            $glue,
11 2
            array_filter($items)
12
        );
13
    }
14
}
15