Completed
Push — master ( ae5e03...0447ee )
by Jeroen
10:35 queued 04:37
created

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