Completed
Pull Request — master (#28)
by Daniel
03:48 queued 01:45
created

SelectColumn::configureOptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
eloc 1
nc 1
nop 1
1
<?php
2
3
namespace Psi\Component\Grid\Column;
4
5
use Psi\Component\Grid\CellInterface;
6
use Psi\Component\Grid\ColumnInterface;
7
use Psi\Component\Grid\RowData;
8
use Psi\Component\Grid\View\Cell as Cell;
9
use Psi\Component\ObjectAgent\AgentFinder;
10
use Symfony\Component\OptionsResolver\OptionsResolver;
11
12
class SelectColumn implements ColumnInterface
13
{
14
    private $agentFinder;
15
16
    public function __construct(AgentFinder $agentFinder)
17
    {
18
        $this->agentFinder = $agentFinder;
19
    }
20
21
    public function createCell(RowData $data, array $options): CellInterface
22
    {
23
        // TODO: This is inefficient and will not work for proxies ...
24
        $agent = $this->agentFinder->findFor(get_class($data->getObject()));
25
26
        return new Cell\SelectCell($agent->getIdentifier($data->getObject()));
27
    }
28
29
    public function configureOptions(OptionsResolver $options)
30
    {
31
    }
32
}
33