Util   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
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 28
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A fixRelativePaths() 0 11 2
1
<?php namespace Arcanedev\Composer\Utilities;
2
3
/**
4
 * Class     Util
5
 *
6
 * @package  Arcanedev\Composer\Utilities
7
 * @author   ARCANEDEV <[email protected]>
8
 */
9
class Util
10
{
11
    /* -----------------------------------------------------------------
12
     |  Main Methods
13
     | -----------------------------------------------------------------
14
     */
15
16
    /**
17
     * Fix a collection of paths that are relative to this package to be
18
     * relative to the base package.
19
     *
20
     * @param  string  $base
21
     * @param  array   $paths
22
     *
23
     * @return array
24
     */
25 9
    public static function fixRelativePaths($base, array $paths)
26
    {
27 9
        $base = dirname($base);
28 9
        $base = ($base === '.') ? '' : "{$base}/";
29
30
        array_walk_recursive($paths, function (&$path) use ($base) {
31 9
            $path = "{$base}{$path}";
32 9
        });
33
34 9
        return $paths;
35
    }
36
}
37