MatcherDictionary::count()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
/**
4
 * This file is part of expect package.
5
 *
6
 * (c) Noritaka Horio <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
namespace expect;
12
13
/**
14
 * Immutable container of matcher.
15
 *
16
 * @author Noritaka Horio <[email protected]>
17
 * @copyright Noritaka Horio <[email protected]>
18
 */
19
final class MatcherDictionary implements MatcherContainer
20
{
21
    use MatcherLookupTable;
22
23
    /**
24
     * Create matcher dictionary.
25
     *
26
     * @param array matcher classes
27
     */
28
    public function __construct(array $matchers)
29
    {
30
        $this->matchers = Dictionary::fromArray($matchers);
31
    }
32
33
    /**
34
     * Count elements of an matcher class.
35
     *
36
     * @return int
37
     */
38
    public function count()
39
    {
40
        return count($this->matchers);
41
    }
42
}
43