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

Input   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A template() 0 21 2
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: shanmaseen
5
 * Date: 09/04/19
6
 * Time: 12:03 م
7
 */
8
namespace Shamaseen\Repository\Generator\Forms;
9
10
class Input extends Forms
11
{
12
13
    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...
14
    {
15
        $required=$this->column->getNotnull()?'required':'';
16
17
        $template = str_replace(
18
            [
19
                '{{columnName}}',
20
                "{{type}}",
21
                "{{required}}",
22
                "{{label}}",
23
            ],
24
            [
25
                $this->column->getName(),
26
                $this->getType(),
27
                $required,
28
                ucfirst(str_replace('_',' ',$this->column->getName()))
29
            ],
30
            $this->getFormStub('input')
31
        );
32
33
        return $template;
34
    }
35
}