NLFMImage   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 25
ccs 9
cts 9
cp 1
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A meta() 0 7 2
A filemanagerPath() 0 7 1
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