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
|
|||
49 | */ |
||
50 | public function getAssembler() : AssemblerInterface |
||
51 | { |
||
52 | return $this->assembler; |
||
53 | } |
||
54 | } |
||
55 |
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.