Passed
Push — master ( 68d467...3da7f9 )
by Mikael
02:33
created

FormElementInput::getHTML()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 11

Duplication

Lines 14
Ratio 100 %

Code Coverage

Tests 10
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 11
nc 1
nop 0
dl 14
loc 14
ccs 10
cts 10
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Anax\HTMLForm;
4
5
/**
6
 * Ordinary input form element
7
 */
8
class FormElementInput extends FormElement
9
{
10
    /**
11
     * Get HTML code for a element.
12
     *
13
     * @return string HTML code for the element.
14
     *
15
     * @SuppressWarnings(PHPMD.UnusedLocalVariable)
16
     */
17 1 View Code Duplication
    public function getHTML()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
18
    {
19 1
        $details = $this->getHTMLDetails();
20 1
        extract($details);
21
22
        return <<<EOD
23 1
<{$wrapperElement}{$wrapperClass}>
24 1
<label for='$id'>$label</label>$brAfterLabel
25 1
<input id='$id'{$type}{$class}{$name}{$value}{$autofocus}{$required}{$readonly}{$placeholder}{$title}{$multiple}{$pattern}{$max}{$min}{$step}/>
26 1
{$messages}
27 1
</{$wrapperElement}>
28 1
<p class='cf-desc'>{$description}</p>
29 1
EOD;
30
    }
31
}
32