Completed
Push — master ( e23ec4...bcf727 )
by Terzi
04:42
created

HandlesVisibility::visibleWhen()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 1
nc 2
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Terranet\Administrator\Field\Traits;
4
5
trait HandlesVisibility
6
{
7
    /** @var null|\Closure */
8
    protected $when;
9
10
    /**
11
     * @return bool
12
     */
13
    public function visibleWhen(): bool
14
    {
15
        return $this->when ? $this->when->call($this, request()) : true;
16
    }
17
}
18