DrawFormEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 29
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getForm() 0 7 2
A setForm() 0 6 1
1
<?php
2
/**
3
 * Webino (http://webino.sk)
4
 *
5
 * @link        https://github.com/webino/WebinoDraw for the canonical source repository
6
 * @copyright   Copyright (c) 2012-2017 Webino, s. r. o. (http://webino.sk)
7
 * @author      Peter Bačinský <[email protected]>
8
 * @license     BSD-3-Clause
9
 */
10
11
namespace WebinoDraw\Event;
12
13
use Zend\Form\Form;
14
use Zend\Form\FormInterface;
15
16
/**
17
 * Class DrawFormEvent
18
 */
19
class DrawFormEvent extends DrawEvent
20
{
21
    /**
22
     * @var FormInterface
23
     */
24
    protected $form;
25
26
    /**
27
     * @return FormInterface
28
     */
29
    public function getForm()
30
    {
31
        if (null === $this->form) {
32
            $this->setForm(new Form);
33
        }
34
        return $this->form;
35
    }
36
37
    /**
38
     * @param FormInterface $form
39
     * @return $this
40
     */
41
    public function setForm(FormInterface $form)
42
    {
43
        $this->setParam('form', $form);
44
        $this->form = $form;
45
        return $this;
46
    }
47
}
48