NamedStringCollection::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * This file is part of the theroadbunch/bouncer package.
4
 *
5
 * (c) Dan McAdams <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace RoadBunch\String;
12
13
14
/**
15
 * Class NamedStringCollection
16
 *
17
 * @author  Dan McAdams
18
 * @package RoadBunch\String
19
 */
20
class NamedStringCollection extends StringCollection implements NamedStringCollectionInterface
21
{
22
    protected $name;
23
24
    /**
25
     * FilterList constructor.
26
     *
27
     * @param string   $name
28
     * @param string[] $elements An array of strings
29
     */
30 11
    public function __construct(string $name, array $elements = [])
31
    {
32 11
        $this->name = $name;
33 11
        parent::__construct($elements);
34 11
    }
35
36
    /**
37
     * The list name
38
     *
39
     * @return string
40
     */
41 11
    public function name(): string
42
    {
43 11
        return $this->name;
44
    }
45
}
46