Completed
Pull Request — master (#2094)
by Sander
50:34 queued 34:10
created

...rticleOverviewPagePagePartAdminConfigurator.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

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
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
    /**
14
     * @var array
15
     */
16
    protected $pagePartTypes;
17
18
    /**
19
     * @param array $pagePartTypes
20
     */
21
    public function __construct(array $pagePartTypes = array())
22
    {
23
        $this->pagePartTypes = array_merge(
24
            array(
25
                array(
26
                    'name' => 'Header',
27
                    'class'=> 'Kunstmaan\PagePartBundle\Entity\HeaderPagePart'
28
                ),
29
                array(
30
                    'name' => 'Text',
31
                    'class'=> 'Kunstmaan\PagePartBundle\Entity\TextPagePart'
32
                ),
33
                array(
34
                    'name' => 'Line',
35
                    'class'=> 'Kunstmaan\PagePartBundle\Entity\LinePagePart'
36
                ),
37
                array(
38
                    'name' => 'TOC',
39
                    'class'=> 'Kunstmaan\PagePartBundle\Entity\TocPagePart'
40
                ),
41
                array(
42
                    'name' => 'Link',
43
                    'class'=> 'Kunstmaan\PagePartBundle\Entity\LinkPagePart'
44
                ),
45
                array(
46
                    'name' => 'To Top',
47
                    'class'=> 'Kunstmaan\PagePartBundle\Entity\ToTopPagePart'
48
                ),
49
                array(
50
                    'name' => 'Image',
51
                    'class'=> 'Kunstmaan\MediaPagePartBundle\Entity\ImagePagePart'
52
                ),
53
                array(
54
                    'name' => 'Download',
55
                    'class'=> 'Kunstmaan\MediaPagePartBundle\Entity\DownloadPagePart'
56
                ),
57
                array(
58
                    'name' => 'Slide',
59
                    'class'=> 'Kunstmaan\MediaPagePartBundle\Entity\SlidePagePart'
60
                ),
61
                array(
62
                    'name' => 'Video',
63
                    'class'=> 'Kunstmaan\MediaPagePartBundle\Entity\VideoPagePart'
64
                )
65
            ), $pagePartTypes
66
        );
67
68
    }
69
70
    /**
71
     * @return array
72
     */
73
    public function getPossiblePagePartTypes()
74
    {
75
        return $this->pagePartTypes;
76
    }
77
78
    /**
79
     * @return string
80
     */
81
    public function getName()
82
    {
83
        return "Page parts";
84
    }
85
86
    /**
87
     * @return string
88
     */
89
    public function getContext()
90
    {
91
        return "main";
92
    }
93
94
    /**
95
     * @return string
96
     */
97
    public function getWidgetTemplate()
98
    {
99
        return "";
100
    }
101
}
102