Passed
Push — master ( 8bd4b7...6113e5 )
by Reza
03:27
created

Select::handle()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
eloc 5
c 1
b 0
f 1
nc 2
nop 2
dl 0
loc 9
rs 10
1
<?php
2
3
namespace EasyPanel\Parsers\HTMLInputs;
4
5
class Select
6
{
7
8
    public function handle($name, $values)
9
    {
10
        $string = '';
11
        foreach ($values as $key => $value) {
12
            $string .= "<option value='$key'>$value</option>\n                    ";
13
        }
14
15
        return "<select wire:model='$name' class=\"form-control @error('$name') is-invalid @enderror\" id='input$name'>
16
                    $string
17
                </select>";
18
    }
19
}
20