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

File::onView()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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