Button   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 3
dl 0
loc 28
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A render() 0 7 1
1
<?php
2
3
/**
4
 * This file is part of slick/form 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\Form\Renderer;
11
12
use Slick\I18n\TranslateMethods;
13
14
/**
15
 * HTML Button renderer
16
 *
17
 * @package Slick\Form\Renderer
18
 */
19
class Button extends Div implements RendererInterface
20
{
21
22
    /**
23
     * Needed for button translation
24
     */
25
    use TranslateMethods;
26
27
    /**
28
     * @var string The template file to use in the rendering
29
     */
30
    public $template = 'form-elements/button.twig';
31
32
    /**
33
     * Render the HTML element in the provided context
34
     *
35
     * @param array $context
36
     *
37
     * @return string The HTML string output
38
     */
39 8
    public function render($context = [])
40
    {
41 8
        $this->element->setValue(
42 8
            $this->translate($this->element->getValue())
43 8
        );
44 8
        return parent::render($context);
45
    }
46
}
47