PathCollection::add()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 2
nop 1
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
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