NewsBoxConfigurator   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 21
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getType() 0 4 1
A addFormFields() 0 8 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