Completed
Push — master ( 359ece...406296 )
by Daniel
11s
created

FilterBar   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 23
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getForm() 0 4 1
A getUrlParametersForFilter() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Psi\Component\Grid;
6
7
use Symfony\Component\Form\FormView;
8
9
class FilterBar
10
{
11
    private $form;
12
    private $options;
13
14
    public function __construct(FormView $form, GridContext $options)
15
    {
16
        $this->form = $form;
17
        $this->options = $options;
18
    }
19
20
    public function getForm(): FormView
21
    {
22
        return $this->form;
23
    }
24
25
    public function getUrlParametersForFilter()
26
    {
27
        return array_filter($this->options->getUrlParameters(), function ($key) {
28
            return $key !== 'filter';
29
        }, ARRAY_FILTER_USE_KEY);
30
    }
31
}
32