Add missing bool casts

This commit is contained in:
Zep Fietje
2023-06-29 10:06:14 +02:00
parent 13d09cb72b
commit ce1194e82d
12 changed files with 19 additions and 19 deletions
@@ -17,6 +17,6 @@ trait CanBeInline
public function isInline(): bool
{
return $this->evaluate($this->isInline);
return (bool) $this->evaluate($this->isInline);
}
}
@@ -17,6 +17,6 @@ trait CanBeOutlined
public function isOutlined(): bool
{
return $this->evaluate($this->isOutlined);
return (bool) $this->evaluate($this->isOutlined);
}
}
@@ -512,7 +512,7 @@ trait CanOpenModal
public function isModalFooterSticky(): bool
{
return $this->evaluate($this->isModalFooterSticky) ?? $this->isModalSlideOver();
return (bool) ($this->evaluate($this->isModalFooterSticky) ?? $this->isModalSlideOver());
}
public function isModalSlideOver(): bool
@@ -522,7 +522,7 @@ trait CanOpenModal
public function isModalHidden(): bool
{
return $this->evaluate($this->isModalHidden);
return (bool) $this->evaluate($this->isModalHidden);
}
public function hasModalCloseButton(): bool
@@ -532,7 +532,7 @@ trait CanOpenModal
public function isModalClosedByClickingAway(): bool
{
return $this->evaluate($this->isModalClosedByClickingAway) ?? Modal::$isClosedByClickingAway;
return (bool) ($this->evaluate($this->isModalClosedByClickingAway) ?? Modal::$isClosedByClickingAway);
}
/**
+1 -1
View File
@@ -36,7 +36,7 @@ trait HasAction
public function isLivewireClickHandlerEnabled(): bool
{
if (($isLivewireClickHandlerEnabled = $this->evaluate($this->isLivewireClickHandlerEnabled)) !== null) {
return $isLivewireClickHandlerEnabled;
return (bool) $isLivewireClickHandlerEnabled;
}
if (filled($this->getUrl())) {
+3 -3
View File
@@ -741,7 +741,7 @@ class Builder extends Field implements Contracts\CanConcealComponents
return false;
}
return $this->evaluate($this->isReorderable);
return (bool) $this->evaluate($this->isReorderable);
}
public function isReorderableWithButtons(): bool
@@ -759,7 +759,7 @@ class Builder extends Field implements Contracts\CanConcealComponents
return false;
}
return $this->evaluate($this->isAddable);
return (bool) $this->evaluate($this->isAddable);
}
public function isDeletable(): bool
@@ -768,7 +768,7 @@ class Builder extends Field implements Contracts\CanConcealComponents
return false;
}
return $this->evaluate($this->isDeletable);
return (bool) $this->evaluate($this->isDeletable);
}
public function hasBlockLabels(): bool
@@ -21,6 +21,6 @@ trait CanBeCloned
return false;
}
return $this->evaluate($this->isCloneable);
return (bool) $this->evaluate($this->isCloneable);
}
}
@@ -17,6 +17,6 @@ trait CanBeMarkedAsRequired
public function isMarkedAsRequired(): string
{
return $this->evaluate($this->isMarkedAsRequired);
return (bool) $this->evaluate($this->isMarkedAsRequired);
}
}
+3 -3
View File
@@ -625,7 +625,7 @@ class Repeater extends Field implements Contracts\CanConcealComponents
return false;
}
return $this->evaluate($this->isReorderable);
return (bool) $this->evaluate($this->isReorderable);
}
public function isReorderableWithButtons(): bool
@@ -643,7 +643,7 @@ class Repeater extends Field implements Contracts\CanConcealComponents
return false;
}
return $this->evaluate($this->isAddable);
return (bool) $this->evaluate($this->isAddable);
}
public function isDeletable(): bool
@@ -652,7 +652,7 @@ class Repeater extends Field implements Contracts\CanConcealComponents
return false;
}
return $this->evaluate($this->isDeletable);
return (bool) $this->evaluate($this->isDeletable);
}
public function isInset(): bool
@@ -35,6 +35,6 @@ trait CanBeCollapsed
public function isCollapsible(): bool
{
return (bool) ($this->evaluate($this->isCollapsible) ?? false);
return (bool) $this->evaluate($this->isCollapsible);
}
}
@@ -192,7 +192,7 @@ class NavigationItem
return false;
}
return app()->call($callback);
return (bool) app()->call($callback);
}
public function shouldOpenUrlInNewTab(): bool
+1 -1
View File
@@ -194,6 +194,6 @@ class IconColumn extends Column
public function isListWithLineBreaks(): bool
{
return $this->evaluate($this->isListWithLineBreaks);
return (bool) $this->evaluate($this->isListWithLineBreaks);
}
}
@@ -120,7 +120,7 @@ trait HasBulkActions
public function isRecordSelectable(Model $record): bool
{
return $this->evaluate(
return (bool) ($this->evaluate(
$this->checkIfRecordIsSelectableUsing,
namedInjections: [
'record' => $record,
@@ -129,7 +129,7 @@ trait HasBulkActions
Model::class => $record,
$record::class => $record,
],
) ?? true;
) ?? true);
}
public function getAllSelectableRecordsCount(): int