Completed
Pull Request — 5.6 (#2830)
by Jeroen
14:14
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
     * @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