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

GridExtension   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 4
dl 0
loc 20
rs 10
c 0
b 0
f 0

2 Methods

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