Passed
Pull Request — master (#7)
by Alex
09:00 queued 01:36
created

FilterManager::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 3
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arp\LaminasDoctrineQueryFilter\Filter;
6
7
use Arp\DoctrineQueryFilter\Filter\FilterFactoryInterface;
8
use Arp\DoctrineQueryFilter\Filter\FilterInterface;
9
use Arp\DoctrineQueryFilter\QueryFilterManagerInterface;
10
use Laminas\ServiceManager\AbstractPluginManager;
11
12
/**
13
 * @author  Alex Patterson <[email protected]>
14
 * @package Arp\LaminasDoctrineQueryFilter
15
 */
16
class FilterManager extends AbstractPluginManager implements FilterFactoryInterface
17
{
18
    /**
19
     * @var string
20
     */
21
    protected $instanceOf = FilterInterface::class;
22
23
    /**
24
     * @param QueryFilterManagerInterface $manager
25
     * @param string                      $name
26
     * @param array<mixed>                $options
27
     *
28
     * @return FilterInterface
29
     */
30
    public function create(QueryFilterManagerInterface $manager, string $name, array $options = []): FilterInterface
31
    {
32
        return $this->build(
33
            $name,
34
            array_replace_recursive($options, ['query_filter_manager' => $manager])
35
        );
36
    }
37
}
38