Passed
Push — master ( 843207...29f725 )
by mark
36:53 queued 19:40
created

ChartWidgetPlugin   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
A getTemplate() 0 3 1
A initialize() 0 6 1
1
<?php
2
3
/**
4
 * Copyright © 2016-present Spryker Systems GmbH. All rights reserved.
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerShop\Yves\ChartWidget\Plugin\CmsContentWidgetChartConnector;
9
10
use Spryker\Yves\Kernel\Widget\AbstractWidgetPlugin;
11
use SprykerShop\Yves\CmsContentWidgetChartConnector\Dependency\Plugin\ChartWidget\ChartWidgetPluginInterface;
12
13
class ChartWidgetPlugin extends AbstractWidgetPlugin implements ChartWidgetPluginInterface
14
{
15
    /**
16
     * @param string $chartPluginName
17
     * @param string|null $dataIdentifier
18
     *
19
     * @return void
20
     */
21
    public function initialize(string $chartPluginName, ?string $dataIdentifier = null): void
22
    {
23
24
        $this
25
            ->addParameter('chartPluginName', $chartPluginName)
26
            ->addParameter('dataIdentifier', $dataIdentifier);
27
    }
28
29
    /**
30
     * @return string
31
     */
32
    public static function getName(): string
33
    {
34
        return static::NAME;
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public static function getTemplate(): string
41
    {
42
        return '@ChartWidget/views/chart/chart.twig';
43
    }
44
}
45