NLFMImage::meta()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 7
ccs 4
cts 4
cp 1
crap 2
rs 10
1
<?php
2
3
namespace ThinkOne\NovaLaravelFilemanager;
4
5
use Laravel\Nova\Fields\Field;
6
7
class NLFMImage extends Field
8
{
9
    /**
10
     * The field's component.
11
     *
12
     * @var string
13
     */
14
    public $component = 'nlfm-image';
15
16 1
    public function filemanagerPath(string $path)
17
    {
18 1
        $this->withMeta([
19 1
            'filemanager_path' => $path,
20 1
        ]);
21
22 1
        return $this;
23
    }
24
25 1
    public function meta()
26
    {
27 1
        if (!isset($this->meta['filemanager_path'])) {
28 1
            $this->meta['filemanager_path'] = config('lfm.filemanager_path', 'filemanager');
29
        }
30
31 1
        return $this->meta;
32
    }
33
}
34