Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Jan 26, 2024
1 parent ca97f18 commit a1769cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
1 change: 0 additions & 1 deletion .github/FUNDING.yml

This file was deleted.

14 changes: 5 additions & 9 deletions src/Traits/ResolvesVisibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,10 @@ public function visibleOn(string|array|Closure $context): static
*/
public function hiddenOn(string|array|Closure $context): static
{
$context = $context instanceof Closure
? static function (array|string $currentContext) use ($context): bool {
return ! call_user_func_array($context, [$currentContext]);
}
: static function (string|array $currentContext) use ($context) {
return empty(array_intersect(Arr::wrap($currentContext), Arr::wrap($context)));
};

return $this->visibleOn($context);
return $this->visibleOn(static function (array|string $currentContext) use ($context): bool {
return $context instanceof Closure
? ! call_user_func_array($context, [$currentContext])
: empty(array_intersect(Arr::wrap($currentContext), Arr::wrap($context)));
});
}
}

0 comments on commit a1769cd

Please sign in to comment.