ColumnPattern   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 12
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A make() 0 11 3
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: georg
5
 * Date: 5/29/2018
6
 * Time: 12:51 PM
7
 */
8
9
namespace Ghaskell\Scaffold;
10
11
12
class ColumnPattern
13
{
14
    public $type;
15
    public $name;
16
    public $config;
17
18
    public static function make(string $name, string $type) {
19
        $column  = new ColumnPattern();
20
        $column->name = $name;
21
        $column->type = $type;
22
        if(!empty(config("scaffold.columnTypes.$type"))) {
23
            foreach(config("scaffold.columnTypes.$type") as $key => $value) {
24
                $key = str_replace('"', "", $key);
25
                $column->{$key} = $value;
26
            }
27
        }
28
        return $column;
29
    }
30
}