Completed
Push — master ( 70aa26...ed7488 )
by Daniel
04:57 queued 02:49
created

SelectColumn   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A buildCell() 0 5 1
A configureOptions() 0 4 1
A getParent() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Psi\Component\Grid\Column;
6
7
use Psi\Component\Grid\ColumnInterface;
8
use Psi\Component\Grid\View\Cell;
9
use Symfony\Component\OptionsResolver\OptionsResolver;
10
11
class SelectColumn implements ColumnInterface
12
{
13
    const INPUT_NAME = '_select';
14
15
    public function buildCell(Cell $cell, array $options)
16
    {
17
        $cell->template = 'Select';
18
        $cell->parameters['input_name'] = self::INPUT_NAME;
19
    }
20
21
    public function configureOptions(OptionsResolver $options)
22
    {
23
        $options->setDefault('property', 'id');
24
    }
25
26
    public function getParent()
27
    {
28
        return PropertyColumn::class;
29
    }
30
}
31