Completed
Pull Request — 2.x (#43)
by jake
02:49 queued 50s
created

Form   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 80%

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 1
c 4
b 0
f 0
lcom 0
cbo 2
dl 0
loc 24
ccs 4
cts 5
cp 0.8
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 12 1
1
<?php
2
/**
3
 *
4
 * This file is part of Aura for PHP.
5
 *
6
 * @license http://opensource.org/licenses/bsd-license.php BSD
7
 *
8
 */
9
namespace Aura\Html\Helper;
10
11
/**
12
 *
13
 * Helper to generate an opening form tag.
14
 *
15
 * @package Aura.Html
16
 *
17
 */
18
class Form extends AbstractHelper
19
{
20
    /**
21
     *
22
     * Helper to generate an opening form tag.
23
     *
24
     * @param array $attr Attributes for the form tag.
25
     *
26
     * @return string
27
     *
28
     */
29 1
    public function __invoke(array $attr = array())
30
    {
31
        $base = array(
32
            'id' => null,
33
            'method' => 'post',
34
            'action' => null,
35
            'enctype' => 'multipart/form-data',
36 1
        );
37
38
        $attr = $this->escaper->attr(array_merge($base, $attr));
39 1
        return "<form $attr>";
40 1
    }
41
}
42