HandlesVisibility   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 3
c 1
b 0
f 1
dl 0
loc 11
ccs 0
cts 2
cp 0
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A visibleWhen() 0 3 2
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;
0 ignored issues
show
Bug introduced by
The function request was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

15
        return $this->when ? $this->when->call($this, /** @scrutinizer ignore-call */ request()) : true;
Loading history...
16
    }
17
}
18