RepositoryForm::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace App\Forms\Builders;
4
5
use App\Repository;
6
use App\Type;
7
use LaravelEnso\Forms\Services\Form;
8
9
class RepositoryForm
10
{
11
    protected const TemplatePath = __DIR__.'/../Templates/repositories.json';
12
13
    protected Form $form;
14
15
    public function __construct()
16
    {
17
        $this->form = new Form(static::TemplatePath);
18
    }
19
20
    public function create()
21
    {
22
        return $this->form
23
        ->options('type_id', Type::all())
24
        ->create();
25
    }
26
27
    public function edit(Repository $repository)
28
    {
29
        return $this->form
30
        ->options('type_id', Type::all())
31
        ->edit($repository);
32
    }
33
}
34