Input::template()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 18
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 2
eloc 11
c 2
b 0
f 0
nc 2
nop 0
dl 0
loc 18
rs 9.9
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Mohammad Shamaseen
5
 * Date: 09/04/19
6
 * Time: 12:03 م.
7
 */
8
9
namespace Shamaseen\Repository\Generator\Forms;
10
11
class Input extends Forms
12
{
13
    public function template()
14
    {
15
        $required = $this->column->getNotnull() ? 'required' : '';
16
17
        return 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
}
34