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

FilterManager   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 5 1
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