Passed
Push — develop ( 98d07f...258763 )
by Ludwig
01:42
created

TextType   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
c 2
b 0
f 0
lcom 0
cbo 1
dl 19
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A configureOptions() 13 13 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
/*
3
 * This file is part of cwdFancyGridBundle
4
 *
5
 * (c)2017 cwd.at GmbH <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
declare(strict_types=1);
11
namespace Cwd\FancyGridBundle\Column;
12
13
use Symfony\Component\OptionsResolver\OptionsResolver;
14
15
/**
16
 * Class TextType
17
 * @package Cwd\FancyGridBundle\Column
18
 * @author Ludwig Ruderstaler <[email protected]>
19
 */
20 View Code Duplication
class TextType extends AbstractColumn
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function configureOptions(OptionsResolver $resolver)
26
    {
27
        parent::configureOptions($resolver);
28
29
        $resolver->setDefaults(array(
30
            'align' => 'left',
31
            'cellAlign' => 'left',
32
            'format' => 'number',
33
            'type' => 'string',
34
        ));
35
36
        $resolver->setAllowedTypes('attr', 'array');
37
    }
38
}
39