Completed
Push — ezp-30882-thumbnail-strategy-i... ( de6b29...42b8c0 )
by
unknown
288:43 queued 276:39
created

QueryFactory::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
5
 * @license For full copyright and license information view LICENSE file distributed with this source code.
6
 */
7
declare(strict_types=1);
8
9
namespace eZ\Publish\Core\Query;
10
11
use eZ\Publish\API\Repository\Values\Content\Query;
12
use eZ\Publish\Core\QueryType\QueryTypeRegistry;
13
14
final class QueryFactory implements QueryFactoryInterface
15
{
16
    /** @var \eZ\Publish\Core\QueryType\QueryTypeRegistry */
17
    private $queryTypeRegistry;
18
19
    public function __construct(QueryTypeRegistry $queryTypeRegistry)
20
    {
21
        $this->queryTypeRegistry = $queryTypeRegistry;
22
    }
23
24
    public function create(string $type, array $parameters = []): Query
25
    {
26
        return $this->queryTypeRegistry->getQueryType($type)->getQuery($parameters);
27
    }
28
}
29