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

StringType   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

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
use Symfony\Component\OptionsResolver\OptionsResolver;
13
14
/**
15
 * Class TextType
16
 * @package Cwd\FancyGridBundle\Column
17
 * @author Ludwig Ruderstaler <[email protected]>
18
 */
19 View Code Duplication
class StringType extends AbstractColumn
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function configureOptions(OptionsResolver $resolver)
25
    {
26
        parent::configureOptions($resolver);
27
28
        $resolver->setDefaults(array(
29
            'align' => 'left',
30
            'cellAlign' => 'left',
31
            'format' => 'number',
32
            'type' => 'string',
33
        ));
34
35
        $resolver->setAllowedTypes('attr', 'array');
36
    }
37
}
38