Completed
Pull Request — master (#21)
by Daniel
02:31
created

GridExtension::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
namespace Psi\Component\Grid\Form;
4
5
use Psi\Component\Grid\CellRegistry;
6
use Psi\Component\Grid\FilterRegistry;
7
use Symfony\Component\Form\AbstractExtension;
8
9
class GridExtension extends AbstractExtension
10
{
11
    private $cellRegistry;
12
    private $filterRegistry;
13
14
    public function __construct(CellRegistry $cellRegistry, FilterRegistry $filterRegistry)
15
    {
16
        $this->cellRegistry = $cellRegistry;
17
        $this->filterRegistry = $filterRegistry;
18
    }
19
20
    public function loadTypes()
21
    {
22
        return [
23
            new Type\FilterType($this->filterRegistry),
24
            new Type\GridType(),
25
            new Type\RowType($this->cellRegistry),
26
        ];
27
    }
28
}
29