Completed
Push — master ( 36a173...8ba542 )
by wen
15:06
created

Images   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
c 2
b 0
f 0
lcom 1
cbo 1
dl 0
loc 30
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getListType() 0 4 1
A cardListType() 0 6 1
A getDefaultExtensions() 0 4 1
A toArray() 0 6 1
1
<?php
2
3
namespace Sco\Admin\Form\Elements;
4
5
class Images extends File
6
{
7
    protected $type = 'images';
8
9
    protected $listType = 'picture';
10
11
    public function getListType()
12
    {
13
        return $this->listType;
14
    }
15
16
    public function cardListType()
17
    {
18
        $this->listType = 'picture-card';
19
20
        return $this;
21
    }
22
23
    protected function getDefaultExtensions()
24
    {
25
        return config('admin.upload.extensions.image');
26
    }
27
28
    public function toArray()
29
    {
30
        return parent::toArray() + [
31
                'listType' => $this->getListType(),
32
            ];
33
    }
34
}
35