Passed
Push — master ( 74ddc4...4602de )
by Mohammad
03:46
created

TextArea::template()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 21
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 12
nc 2
nop 0
dl 0
loc 21
rs 9.8666
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: shanmaseen
5
 * Date: 09/04/19
6
 * Time: 12:02 م
7
 */
8
9
namespace Shamaseen\Repository\Generator\Forms;
10
11
class TextArea extends Forms
12
{
13
14
    function template()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
15
    {
16
        $required=$this->column->getNotnull()?'required':'';
17
18
        $template = str_replace(
19
            [
20
                '{{columnName}}',
21
                "{{type}}",
22
                "{{required}}",
23
                "{{label}}",
24
            ],
25
            [
26
                $this->column->getName(),
27
                $this->getType(),
28
                $required,
29
                ucfirst(str_replace('_',' ',$this->column->getName()))
30
            ],
31
            $this->getFormStub('textArea')
32
        );
33
34
        return $template;
35
    }
36
}