Passed
Push — master ( 2afdeb...b846a2 )
by Nikolaos
06:23 queued 03:51
created

Form::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 10
ccs 4
cts 4
cp 1
crap 1
rs 10
1
<?php
2
3
/**
4
 * This file is part of the Phalcon Framework.
5
 *
6
 * For the full copyright and license information, please view the LICENSE.md
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace Phalcon\Html\Helper;
13
14
use Phalcon\Html\Exception;
15
16
/**
17
 * Class Form
18
 */
19
class Form extends AbstractHelper
20
{
21
    /**
22
     * Produce a <form> tag.
23
     *
24
     * @param array $attributes
25
     *
26
     * @return string
27
     * @throws Exception
28
     */
29 1
    public function __invoke(array $attributes = [])
30
    {
31
        $overrides = [
32 1
            "method"  => "post",
33
            "enctype" => "multipart/form-data",
34
        ];
35
36 1
        $overrides = $this->orderAttributes($overrides, $attributes);
37
38 1
        return $this->renderElement("form", $overrides);
39
    }
40
}
41