Passed
Push — master ( 9925c8...02f327 )
by Thomas
03:39 queued 01:47
created

ImageField::disk()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Webfactor\Laravel\Backpack\FluentSyntax\Fields;
4
5
use Webfactor\Laravel\Backpack\FluentSyntax\Contracts\CrudFieldAbstract;
6
use Webfactor\Laravel\Backpack\FluentSyntax\Traits\Defaultable;
7
use Webfactor\Laravel\Backpack\FluentSyntax\Traits\Hintable;
8
use Webfactor\Laravel\Backpack\FluentSyntax\Traits\Prefixable;
9
use Webfactor\Laravel\Backpack\FluentSyntax\Traits\Suffixable;
10
11
class ImageField extends CrudFieldAbstract
12
{
13
    use Hintable;
14
15
    protected $type = 'image';
16
17
    public function crop()
18
    {
19
        $this->options['crop'] = true;
20
21
        return $this;
22
    }
23
24
    public function ratio(float $ratio = 1)
25
    {
26
        $this->options['aspect_ratio'] = $ratio;
27
28
        return $this;
29
    }
30
31
    public function disk(string $disk)
32
    {
33
        $this->options['disk'] = $disk;
34
35
        return $this;
36
    }
37
38
    public function prefix(string $path)
39
    {
40
        $this->options['prefix'] = $path;
41
42
        return $this;
43
    }
44
}
45