Skip to content

Commit 8fbf25d

Browse files
committed
Refactor onDisplay getVisibled
1 parent 814f5a0 commit 8fbf25d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Traits/VisibleCondition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
trait VisibleCondition
88
{
99
/**
10-
* @var Closure|null
10+
* @var Closure|bool
1111
*/
1212
protected $visibleCondition = true;
1313

src/Traits/Visibled.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@
77
trait Visibled
88
{
99
/**
10-
* @var bool|callable
10+
* @var Closure|bool
1111
*/
1212
protected $visibled = true;
1313

1414
/**
15-
* @return bool|callable
15+
* @return Closure|bool
1616
*/
1717
public function getVisibled()
1818
{
19-
if (is_bool($this->visibled)) {
20-
return $this->visibled;
19+
if (is_callable($this->visibled)) {
20+
return (bool) call_user_func($this->visibled, $this->getModel());
2121
}
2222

23-
return (bool) $this->getValueFromObject($this->getModel(), $this->visibled);
23+
return (bool) $this->visibled;
2424
}
2525

2626
/**

0 commit comments

Comments
 (0)