Completed
Push — master ( 18b45e...7f1aca )
by Daniel
8s
created

TextColumn::buildCell()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 5
Ratio 100 %

Importance

Changes 0
Metric Value
dl 5
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
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 View Code Duplication
class TextColumn implements ColumnInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
12
{
13
    public function buildCell(Cell $cell, array $options)
14
    {
15
        $cell->template = 'Text';
16
        $cell->parameters['truncate'] = $options['truncate'];
17
    }
18
19
    public function configureOptions(OptionsResolver $options)
20
    {
21
        $options->setDefault('truncate', null);
22
    }
23
24
    public function getParent()
25
    {
26
        return PropertyColumn::class;
27
    }
28
}
29