NLFMImage::filemanagerPath()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 7
ccs 5
cts 5
cp 1
crap 1
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