Skip to content

Commit e0da516

Browse files
committed
Fix psalm
1 parent 0f13750 commit e0da516

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

src/DataTableComponent.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,25 +124,33 @@ public function __construct($id = null)
124124
*
125125
* @return Builder
126126
*/
127-
public function getRowsQueryProperty(): Builder
127+
public function rowsQuery(): Builder
128128
{
129129
$this->cleanFilters();
130130

131131
return $this->applySorting($this->query());
132132
}
133133

134+
/**
135+
* @return Builder
136+
*/
137+
public function getRowsQueryProperty(): Builder
138+
{
139+
return $this->rowsQuery();
140+
}
141+
134142
/**
135143
* Get the rows paginated collection that will be returned to the view.
136144
*
137-
* @return LengthAwarePaginator|Collection
145+
* @return Builder[]|\Illuminate\Database\Eloquent\Collection|mixed
138146
*/
139147
public function getRowsProperty()
140148
{
141149
if ($this->paginationEnabled) {
142-
return $this->applyPagination($this->rowsQuery);
150+
return $this->applyPagination($this->rowsQuery());
143151
}
144152

145-
return $this->rowsQuery->get();
153+
return $this->rowsQuery()->get();
146154
}
147155

148156
/**

src/Traits/WithBulkActions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function resetBulk(): void
5757

5858
public function getSelectedRowsQueryProperty()
5959
{
60-
return (clone $this->rowsQuery)
60+
return (clone $this->rowsQuery())
6161
->unless($this->selectAll, fn ($query) => $query->whereKey($this->selected));
6262
}
6363
}

0 commit comments

Comments
 (0)