FormBuilder   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 29
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A addField() 0 4 1
A getResult() 0 4 1
A createForm() 0 4 1
A setMethod() 0 4 1
A setAction() 0 4 1
1
<?php
2
3
namespace Creational\Builder;
4
5
use Creational\Builder\FormField\FormField;
6
7
class FormBuilder
8
{
9
    private $form;
10
    
11
    public function addField(FormField $field)
12
    {
13
        $this->form->addField($field);
14
    }
15
16
    public function getResult()
17
    {
18
        return $this->form;
19
    }
20
21
    public function createForm()
22
    {
23
        $this->form = new Form();
24
    }
25
26
    public function setMethod($method)
27
    {
28
        $this->form->setMethod($method);
29
    }
30
31
    public function setAction($action)
32
    {
33
        $this->form->setAction($action);
34
    }
35
}
36