PathCollection   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 16
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 Sinergi\Config\Path;
4
5
use Exception;
6
use Sinergi\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
    public function add($path)
19
    {
20
        if (!$path instanceof Path) {
21
            $path = new Path($path);
22
        }
23
        $this->container[] = $path;
24
        return true;
25
    }
26
}
27