Completed
Pull Request — 5.6 (#2830)
by Jeroen
14:14
created

__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 47

Duplication

Lines 47
Ratio 100 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 47
loc 47
ccs 4
cts 4
cp 1
rs 9.1563
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Kunstmaan\ArticleBundle\PagePartAdmin;
4
5
use Kunstmaan\PagePartBundle\PagePartAdmin\AbstractPagePartAdminConfigurator;
6
7
/**
8
 * The PagePartAdminConfigurator for the AbstractArticleOverviewPage
9
 */
10 View Code Duplication
class AbstractArticleOverviewPagePagePartAdminConfigurator extends AbstractPagePartAdminConfigurator
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...
11
{
12
    /**
13
     * @var array
14
     */
15
    protected $pagePartTypes;
16
17 2
    public function __construct(array $pagePartTypes = [])
18
    {
19 2
        $this->pagePartTypes = array_merge(
20
            [
21
                [
22 2
                    'name' => 'Header',
23
                    'class' => 'Kunstmaan\PagePartBundle\Entity\HeaderPagePart',
24
                ],
25
                [
26
                    'name' => 'Text',
27
                    'class' => 'Kunstmaan\PagePartBundle\Entity\TextPagePart',
28
                ],
29
                [
30
                    'name' => 'Line',
31
                    'class' => 'Kunstmaan\PagePartBundle\Entity\LinePagePart',
32
                ],
33
                [
34
                    'name' => 'TOC',
35
                    'class' => 'Kunstmaan\PagePartBundle\Entity\TocPagePart',
36
                ],
37
                [
38
                    'name' => 'Link',
39
                    'class' => 'Kunstmaan\PagePartBundle\Entity\LinkPagePart',
40
                ],
41
                [
42
                    'name' => 'To Top',
43
                    'class' => 'Kunstmaan\PagePartBundle\Entity\ToTopPagePart',
44
                ],
45
                [
46
                    'name' => 'Image',
47
                    'class' => 'Kunstmaan\MediaPagePartBundle\Entity\ImagePagePart',
48
                ],
49
                [
50
                    'name' => 'Download',
51
                    'class' => 'Kunstmaan\MediaPagePartBundle\Entity\DownloadPagePart',
52
                ],
53
                [
54
                    'name' => 'Slide',
55
                    'class' => 'Kunstmaan\MediaPagePartBundle\Entity\SlidePagePart',
56
                ],
57
                [
58
                    'name' => 'Video',
59
                    'class' => 'Kunstmaan\MediaPagePartBundle\Entity\VideoPagePart',
60
                ],
61
            ], $pagePartTypes
62
        );
63 2
    }
64
65
    /**
66
     * @return array
67
     */
68 1
    public function getPossiblePagePartTypes()
69
    {
70 1
        return $this->pagePartTypes;
71
    }
72
73
    /**
74
     * @return string
75
     */
76 1
    public function getName()
77
    {
78 1
        return 'Page parts';
79
    }
80
81
    /**
82
     * @return string
83
     */
84 1
    public function getContext()
85
    {
86 1
        return 'main';
87
    }
88
89
    /**
90
     * @return string
91
     */
92 1
    public function getWidgetTemplate()
93
    {
94 1
        return '';
95
    }
96
}
97