Completed
Pull Request — master (#2657)
by
unknown
10:57
created

Descriptor/Builder/AssemblerMatcher.php (1 issue)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * This file is part of phpDocumentor.
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * @link https://phpdoc.org
12
 */
13
14
namespace phpDocumentor\Descriptor\Builder;
15
16
/**
17
 * @template TDescriptor as \phpDocumentor\Descriptor\Descriptor
18
 * @template TInput as object
19
 */
20
final class AssemblerMatcher
21
{
22
    /** @var callable */
23
    private $matcher;
24
25
    /** @var AssemblerInterface<TDescriptor, TInput> */
26
    private $assembler;
27
28
    /**
29
     * @param AssemblerInterface<TDescriptor, TInput> $assembler
30
     */
31
    public function __construct(callable $matcher, AssemblerInterface $assembler)
32
    {
33
        $this->matcher   = $matcher;
34
        $this->assembler = $assembler;
35
    }
36
37
    /**
38
     * @param TInput $criteria
39
     */
40
    public function match(object $criteria) : bool
41
    {
42
        $matcher = $this->matcher;
43
44
        return $matcher($criteria);
45
    }
46
47
    /**
48
     * @return AssemblerInterface<TDescriptor, TInput>
0 ignored issues
show
The doc-type AssemblerInterface<TDescriptor, could not be parsed: Expected "|" or "end of type", but got "<" at position 18. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
49
     */
50
    public function getAssembler() : AssemblerInterface
51
    {
52
        return $this->assembler;
53
    }
54
}
55