FormEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getBuilder() 0 4 1
A getData() 0 4 1
A __construct() 0 5 1
1
<?php
2
3
/*
4
 * (c) Jim Martens <[email protected]>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace TwoMartens\Bundle\CoreBundle\Event;
11
12
use Symfony\Component\EventDispatcher\Event;
13
use Symfony\Component\Form\FormBuilderInterface;
14
15
/**
16
 * Event object used for form building.
17
 *
18
 * @author    Jim Martens <[email protected]>
19
 * @copyright 2013-2015 Jim Martens
20
 */
21
class FormEvent extends Event
22
{
23
    /**
24
     * the form itself
25
     * @var FormBuilderInterface
26
     */
27
    private $builder;
28
29
    /**
30
     * the data provided by the form
31
     * @var mixed
32
     */
33
    private $data;
34
35
    /**
36
     * Initializes the event.
37
     *
38
     * @param FormBuilderInterface $builder
39
     * @param mixed                $data
40
     */
41
    public function __construct(FormBuilderInterface $builder, $data)
42
    {
43
        $this->builder = $builder;
44
        $this->data = $data;
45
    }
46
47
    /**
48
     * Returns the builder.
49
     *
50
     * @return FormBuilderInterface
51
     */
52
    public function getBuilder()
53
    {
54
        return $this->builder;
55
    }
56
57
    /**
58
     * Returns the provided data.
59
     *
60
     * @return mixed
61
     */
62
    public function getData()
63
    {
64
        return $this->data;
65
    }
66
}
67