InputList   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 17
c 1
b 0
f 0
dl 0
loc 24
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 7 2
1
<?php
2
3
4
namespace EasyPanel\Parsers\HTMLInputs;
5
6
7
abstract class InputList
8
{
9
    const inputClassMap = [
10
        'password' => Password::class,
11
        'text' => Text::class,
12
        'file' => File::class,
13
        'email' => Email::class,
14
        'number' => Number::class,
15
        'textarea' => Textarea::class,
16
        'select' => Select::class,
17
        'ckeditor' => Ckeditor::class,
18
        'checkbox' => Checkbox::class,
19
        'date' => Date::class,
20
        'datetime' => DateTime::class,
21
        'time' => Time::class,
22
    ];
23
24
    public static function get($name)
25
    {
26
        if (!key_exists($name, static::inputClassMap)){
27
            throw new \Exception("The [$name] input type doesn't exist in input list!");
28
        }
29
30
        return static::inputClassMap[$name];
31
    }
32
}
33