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

AssemblerMatcher   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A match() 0 5 1
A getAssembler() 0 4 1
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