FieldTypes   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 23
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A addFieldType() 0 4 1
A getFieldClass() 0 4 1
1
<?php
2
3
namespace Hechoenlaravel\JarvisFoundation\Field;
4
5
/**
6
 * Class FieldTypes
7
 * @package Hechoenlaravel\JarvisFoundation\Field
8
 */
9
class FieldTypes
10
{
11
    /**
12
     * The field types registred
13
     * @var array
14
     */
15
    public $types = [];
16
17
18
    /**
19
     * Add a field type to the stack
20
     * @param $field
21
     */
22
    public function addFieldType($field)
23
    {
24
        $this->types[$field['type']] = $field['class'];
25
    }
26
27
    public function getFieldClass($type)
28
    {
29
        return app($this->types[$type]);
30
    }
31
}
32