Passed
Push — master ( 3a8b1f...98e6d6 )
by Curtis
17:52 queued 13:46
created

CitationForm::edit()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
namespace App\Forms\Builders;
4
5
use App\Source;
6
use App\Citation;
7
use LaravelEnso\Forms\app\Services\Form;
8
9
class CitationForm
10
{
11
    private const TemplatePath = __DIR__.'/../Templates/citation.json';
12
13
    private $form;
14
15
    public function __construct()
16
    {
17
        $this->form = new Form(self::TemplatePath);
18
    }
19
20
    public function create()
21
    {
22
        return $this->form->options('source_id', Source::get(['sources.name', 'sources.id']))
23
            ->create();
24
    }
25
26
    public function edit(Citation $citation)
27
    {
28
        return $this->form->options('source_id', Source::get(['sources.name', 'sources.id']))
29
            ->edit($citation);
30
    }
31
}
32