Completed
Push — master ( 68fe25...8e1e8c )
by Woody
11s
created

PathCollection   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A add() 0 8 2
1
<?php
2
3
namespace Northwoods\Config\Path;
4
5
use Exception;
6
use Northwoods\Config\ArrayCollection;
7
8
/**
9
 * @method Path get($key)
10
 */
11
class PathCollection extends ArrayCollection
12
{
13
    /**
14
     * @param string|Path $path
15
     * @return bool
16
     * @throws Exception
17
     */
18 26
    public function add($path)
19
    {
20 26
        if (!$path instanceof Path) {
21 26
            $path = new Path($path);
22
        }
23 25
        $this->container[] = $path;
24 25
        return true;
25
    }
26
}
27