FormEvent::getBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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