Completed
Push — master ( 1fff09...65b094 )
by Terzi
05:17
created

File   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 9
dl 0
loc 32
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A onView() 0 3 1
A onEdit() 0 3 1
A onIndex() 0 4 1
1
<?php
2
3
namespace Terranet\Administrator\Field;
4
5
use Illuminate\Support\Facades\View;
6
use Terranet\Administrator\Scaffolding;
7
8
class File extends Generic
9
{
10
    protected $visibility = [
11
        Scaffolding::PAGE_INDEX => true,
12
        Scaffolding::PAGE_EDIT => true,
13
        Scaffolding::PAGE_VIEW => true,
14
    ];
15
16
    /**
17
     * @return null|mixed|string
18
     */
19
    protected function onIndex()
20
    {
21
        return [
22
            'attachment' => $this->model->{$this->id},
23
        ];
24
    }
25
26
    /**
27
     * @return \Illuminate\Contracts\View\View
28
     */
29
    public function onEdit()
30
    {
31
        return $this->onIndex();
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->onIndex() returns the type array which is incompatible with the documented return type Illuminate\Contracts\View\View.
Loading history...
32
    }
33
34
    /**
35
     * @return \Illuminate\Contracts\View\View
36
     */
37
    public function onView()
38
    {
39
        return $this->onIndex();
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->onIndex() returns the type array which is incompatible with the documented return type Illuminate\Contracts\View\View.
Loading history...
40
    }
41
}
42