Completed
Push — develop ( 0b8425...c51867 )
by Jaap
15s queued 11s
created

AssemblerMatcher::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * This file is part of phpDocumentor.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @author    Mike van Riel <[email protected]>
9
 * @copyright 2010-2019 Mike van Riel / Naenius (http://www.naenius.com)
10
 * @license   http://www.opensource.org/licenses/mit-license.php MIT
11
 * @link      http://phpdoc.org
12
 *
13
 *
14
 */
15
16
namespace phpDocumentor\Descriptor\Builder;
17
18
final class AssemblerMatcher
19
{
20
    /**
21
     * @var callable
22
     */
23
    private $matcher;
24
25
    /**
26
     * @var AssemblerInterface
27
     */
28
    private $assembler;
29
30
    public function __construct(callable $matcher, AssemblerInterface $assembler)
31
    {
32
        $this->matcher = $matcher;
33
        $this->assembler = $assembler;
34
    }
35
36
    public function match($criteria): bool
37
    {
38
        $matcher = $this->matcher;
39
        return $matcher($criteria);
40
    }
41
42
    public function getAssembler(): AssemblerInterface
43
    {
44
        return $this->assembler;
45
    }
46
}
47