Passed
Push — master ( 28f242...472b4c )
by Gabriel
04:44
created

Helper   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 88.89%

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 24
ccs 8
cts 9
cp 0.8889
rs 10
c 0
b 0
f 0
wmc 5

1 Method

Rating   Name   Duplication   Size   Complexity  
A normalizePath() 0 15 5
1
<?php
2
3
namespace ByTIC\Migrations\Utility;
4
5
/**
6
 * Class Helper
7
 * @package ByTIC\Migrations\Utility
8
 */
9
class Helper
10
{
11
    use Traits\HasBasePathTrait;
12
    use Traits\HasCommandPathTrait;
13
14
    /**
15
     * @param mixed ...$parts
16
     * @return string
17
     */
18 9
    public static function normalizePath(...$parts)
19
    {
20 9
        $path = '';
21
22 9
        if (is_array($parts[0]) && count($parts[0]) > 1) {
23
            $parts = $parts[0];
24
        }
25 9
        if (is_string($parts[0])) {
26 9
            $path = $parts[0];
27
        }
28 9
        if (count($parts) > 1) {
29 9
            $path = implode(DIRECTORY_SEPARATOR, $parts);
30
        }
31
32 9
        return $path;
33
    }
34
}
35