Completed
Push — master ( cafe6d...6b87b2 )
by Adam
07:21 queued 01:33
created

NewsFeedBoxConfigurator   A

Coupling/Cohesion

Components 0
Dependencies 3

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 23
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 9 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: diversantvlz
5
 * Date: 19.04.2017
6
 * Time: 18:37
7
 */
8
9
namespace WellCommerce\Bundle\CmsBundle\Configurator;
10
11
use WellCommerce\Bundle\CmsBundle\Controller\Box\NewsFeedBoxController;
12
use WellCommerce\Bundle\CoreBundle\Layout\Configurator\AbstractLayoutBoxConfigurator;
13
use WellCommerce\Component\Form\Elements\FormInterface;
14
use WellCommerce\Component\Form\FormBuilderInterface;
15
16
class NewsFeedBoxConfigurator extends AbstractLayoutBoxConfigurator
17
{
18
19
    public function __construct(NewsFeedBoxController $controller)
20
    {
21
        $this->controller = $controller;
22
    }
23
24
    public function getType(): string
25
    {
26
        return 'NewsFeed';
27
    }
28
29
    public function addFormFields(FormBuilderInterface $builder, FormInterface $form, $defaults)
30
    {
31
        $fieldset = $this->getFieldset($builder, $form);
32
33
        $fieldset->addChild($builder->getElement('text_field', [
34
            'name'  => 'per_page',
35
            'label' => 'news_feed.layout_box.per_page',
36
        ]));
37
    }
38
}