Passed
Push — master ( 125477...635d48 )
by Gabor
07:46
created

SimplePreset   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 0 13 1
1
<?php
2
/**
3
 * WebHemi.
4
 *
5
 * PHP version 7.1
6
 *
7
 * @copyright 2012 - 2017 Gixx-web (http://www.gixx-web.com)
8
 * @license   https://opensource.org/licenses/MIT The MIT License (MIT)
9
 *
10
 * @link      http://www.gixx-web.com
11
 */
12
declare(strict_types = 1);
13
14
namespace WebHemi\Form\Preset;
15
16
use WebHemi\Form\Element\Html\HtmlElement;
17
18
/**
19
 * Class SimplePreset
20
 *
21
 * @codeCoverageIgnore - only composes an object.
22
 */
23
class SimplePreset extends AbstractPreset
24
{
25
    /**
26
     * Initialize and add elements to the form.
27
     *
28
     * @return void
29
     */
30
    protected function init() : void
31
    {
32
        $this->formAdapter->initialize('simple', '', 'POST');
33
34
        $submit = $this->createElement(
35
            HtmlElement::class,
36
            HtmlElement::HTML_ELEMENT_SUBMIT,
37
            'submit',
38
            'Submit'
39
        );
40
41
        $this->formAdapter->addElement($submit);
42
    }
43
}
44