Skip to content

Commit 3ad9597

Browse files
committed
trying to fix phpstan errors
1 parent 2ab90f3 commit 3ad9597

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
},
2424
"require-dev": {
2525
"nunomaduro/larastan": "^2.1",
26-
"orchestra/testbench": "^7.3",
27-
"yajra/laravel-datatables-html": "^9.0"
26+
"orchestra/testbench": "^7.3"
2827
},
2928
"suggest": {
3029
"yajra/laravel-datatables-buttons": "Plugin for server-side exporting of dataTables.",

src/DataTables.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ public function getConfig()
112112
*/
113113
public function query(QueryBuilder $builder): QueryDataTable
114114
{
115+
/** @var string */
115116
$dataTable = config('datatables.engines.query');
116117

117118
$this->validateDataTable($dataTable, QueryDataTable::class);
@@ -127,6 +128,7 @@ public function query(QueryBuilder $builder): QueryDataTable
127128
*/
128129
public function eloquent(EloquentBuilder $builder): EloquentDataTable
129130
{
131+
/** @var string */
130132
$dataTable = config('datatables.engines.eloquent');
131133

132134
$this->validateDataTable($dataTable, EloquentDataTable::class);
@@ -142,6 +144,7 @@ public function eloquent(EloquentBuilder $builder): EloquentDataTable
142144
*/
143145
public function collection($collection): CollectionDataTable
144146
{
147+
/** @var string */
145148
$dataTable = config('datatables.engines.collection');
146149

147150
$this->validateDataTable($dataTable, CollectionDataTable::class);
@@ -173,7 +176,7 @@ public function getHtmlBuilder()
173176
*
174177
* @throws \Yajra\DataTables\Exceptions\Exception
175178
*/
176-
public function validateDataTable(string $engine, string $parent)
179+
public function validateDataTable(string $engine, string $parent): void
177180
{
178181
if (! ($engine == $parent || is_subclass_of($engine, $parent))) {
179182
$this->throwInvalidEngineException($engine, $parent);
@@ -184,9 +187,11 @@ public function validateDataTable(string $engine, string $parent)
184187
* @param string $engine
185188
* @param string $parent
186189
*
190+
* @return void
191+
*
187192
* @throws \Yajra\DataTables\Exceptions\Exception
188193
*/
189-
public function throwInvalidEngineException(string $engine, string $parent)
194+
public function throwInvalidEngineException(string $engine, string $parent): void
190195
{
191196
throw new Exception("The given datatable engine `{$engine}` is not compatible with `{$parent}`.");
192197
}

0 commit comments

Comments
 (0)