NewsBoxConfigurator::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * WellCommerce Open-Source E-Commerce Platform
4
 *
5
 * This file is part of the WellCommerce package.
6
 *
7
 * (c) Adam Piotrowski <[email protected]>
8
 *
9
 * For the full copyright and license information,
10
 * please view the LICENSE file that was distributed with this source code.
11
 */
12
13
namespace WellCommerce\Bundle\CmsBundle\Service\Layout\Configurator;
14
15
use WellCommerce\Bundle\CmsBundle\Controller\Box\NewsBoxController;
16
use WellCommerce\Bundle\CoreBundle\Layout\Configurator\AbstractLayoutBoxConfigurator;
17
use WellCommerce\Component\Form\Elements\FormInterface;
18
use WellCommerce\Component\Form\FormBuilderInterface;
19
20
/**
21
 * Class NewsBoxConfigurator
22
 *
23
 * @author  Adam Piotrowski <[email protected]>
24
 */
25
final class NewsBoxConfigurator extends AbstractLayoutBoxConfigurator
26
{
27
    public function __construct(NewsBoxController $controller)
28
    {
29
        $this->controller = $controller;
30
    }
31
    
32
    public function getType(): string
33
    {
34
        return 'News';
35
    }
36
    
37
    public function addFormFields(FormBuilderInterface $builder, FormInterface $form, $defaults)
38
    {
39
        $fieldset = $this->getFieldset($builder, $form);
40
        
41
        $fieldset->addChild($builder->getElement('tip', [
42
            'tip' => 'layout_box.news.tip',
43
        ]));
44
    }
45
}
46