@@ -79,7 +79,7 @@ class Filter
7979 /**
8080 * Filter constructor
8181 *
82- * @param null $query
82+ * @param Illuminate\Database\Query\Builder $query
8383 * @param Request $request
8484 * @param null $filters
8585 * @param string $submitRoute
@@ -91,11 +91,11 @@ class Filter
9191 public static function init (
9292 $ query = null ,
9393 Request $ request ,
94- $ filters = null ,
95- $ submitRoute = '' ,
96- $ cancelRoute = '' ,
97- $ initMode = '' ,
98- $ fieldsInRow = 4
94+ array $ filters = null ,
95+ string $ submitRoute = '' ,
96+ string $ cancelRoute = '' ,
97+ string $ initMode = '' ,
98+ int $ fieldsInRow = 4
9999 ): Filter
100100 {
101101 self ::$ debug = true ;
@@ -175,7 +175,7 @@ public static function setFilterFields($filterFields): void
175175 * Get filter fields
176176 * @return array
177177 */
178- public static function getFilterFields ():array
178+ public static function getFilterFields (): array
179179 {
180180 return self ::$ filterFields ;
181181 }
@@ -194,7 +194,7 @@ public static function setSubmitRoute($route = ''): void
194194 * Get submit route
195195 * @return string
196196 */
197- public static function getSubmitRoute ():string
197+ public static function getSubmitRoute (): string
198198 {
199199 return self ::$ submitRoute ;
200200 }
@@ -223,7 +223,7 @@ public static function setFieldsInRow(int $count = 4): void
223223 * Get cancel route
224224 * @return string
225225 */
226- public static function getCancelRoute ():string
226+ public static function getCancelRoute (): string
227227 {
228228 return self ::$ cancelRoute ;
229229 }
@@ -233,7 +233,7 @@ public static function getCancelRoute():string
233233 * @param string $mode
234234 * @return void
235235 */
236- public static function setMode ($ mode ):void
236+ public static function setMode ($ mode ): void
237237 {
238238 self ::$ mode = (strtolower ($ mode ) === 'collapsed ' ? 'collapsed ' : 'opened ' );
239239 }
@@ -243,7 +243,7 @@ public static function setMode($mode):void
243243 * @param string $query
244244 * @return void
245245 */
246- public static function setQuery ($ query ):void
246+ public static function setQuery ($ query ): void
247247 {
248248 self ::$ query = $ query ;
249249 }
@@ -424,7 +424,7 @@ public static function filter(): ?Filter
424424 * @param array $filter
425425 * @return void
426426 */
427- private static function prepareWhereClause ($ key , $ value , $ filter = []): void
427+ private static function prepareWhereClause (string $ key , $ value , array $ filter = []): void
428428 {
429429 $ compareType = $ filter ['compareType ' ] ?? '= ' ;
430430 $ relation = $ filter ['relation ' ] ?? null ;
@@ -460,7 +460,7 @@ private static function prepareWhereClause($key, $value, $filter = []): void
460460 * @param null|object $query
461461 * @return void
462462 */
463- private static function setWhereClause ($ key , $ value , $ compareType , $ query = null ): void
463+ private static function setWhereClause (string $ key , $ value , string $ compareType , array $ query = null ): void
464464 {
465465 $ q = empty ($ query ) ? self ::$ query : $ query ;
466466
@@ -552,7 +552,7 @@ public static function renderFields()
552552// <div class="card-body py-1'.(self::$mode == 'opened' || $filterFields['act'] === 'search' ? '' : ' collapse').'">
553553// <form action="'.self::getSubmitRoute().'" method="GET">
554554// <input type="hidden" name="act" value="search">'.PHP_EOL;
555-
555+
556556 $ count = 0 ;
557557 $ filterFieldsContent = '<div class="row mb-n2"> ' .PHP_EOL ;
558558 foreach ($ filters as $ key => $ filter ) {
0 commit comments