RepositoryForm   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 10
c 1
b 0
f 0
dl 0
loc 23
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A edit() 0 5 1
A create() 0 5 1
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