Completed
Push — master ( 37b943...607dad )
by Filipe
06:01
created

EntityForm   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 20
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getData() 0 8 2
1
<?php
2
3
/**
4
 * This file is part of slick/mvc package
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 Slick\Mvc\Form;
11
12
use Slick\Form\Form;
13
use Slick\Form\FormInterface;
14
15
/**
16
 * Entity Form
17
 * 
18
 * @package Slick\Mvc\Form
19
 * @author  Filipe Silva <[email protected]>
20
 */
21
class EntityForm extends Form implements FormInterface
22
{
23
24
    /**
25
     * Returns submitted or current data
26
     *
27
     * This method overrides the default behavior to unset the form-id from
28
     * submitted data if it exists.
29
     * 
30
     * @return array
31
     */
32 4
    public function getData()
33
    {
34 4
        $data = parent::getData();
35 4
        if (array_key_exists('form-id', $data)) {
36 4
            unset($data['form-id']);
37 2
        }
38 4
        return $data;
39
    }
40
}