@@ -120,21 +120,19 @@ abstract class DataTableAbstract implements DataTable
120120 /**
121121 * Can the DataTable engine be created with these parameters.
122122 *
123- * @param mixed $source
124123 * @return bool
125124 */
126- public static function canCreate ($ source )
125+ public static function canCreate (mixed $ source )
127126 {
128127 return false ;
129128 }
130129
131130 /**
132131 * Factory method, create and return an instance for the DataTable engine.
133132 *
134- * @param mixed $source
135133 * @return static
136134 */
137- public static function create ($ source )
135+ public static function create (mixed $ source )
138136 {
139137 return new static ($ source );
140138 }
@@ -162,9 +160,7 @@ public function formatColumn($columns, $formatter): static
162160 foreach ((array ) $ columns as $ column ) {
163161 $ this ->addColumn (
164162 $ column .'_formatted ' ,
165- function ($ row ) use ($ column , $ formatter ) {
166- return $ formatter (data_get ($ row , $ column ), $ row );
167- }
163+ fn ($ row ) => $ formatter (data_get ($ row , $ column ), $ row )
168164 );
169165 }
170166
@@ -174,9 +170,7 @@ function ($row) use ($column, $formatter) {
174170 foreach ((array ) $ columns as $ column ) {
175171 $ this ->addColumn (
176172 $ column .'_formatted ' ,
177- function ($ row ) use ($ column ) {
178- return data_get ($ row , $ column );
179- }
173+ fn ($ row ) => data_get ($ row , $ column )
180174 );
181175 }
182176
@@ -425,11 +419,9 @@ public function addRowAttr($key, $value): static
425419 /**
426420 * Append data on json response.
427421 *
428- * @param mixed $key
429- * @param mixed $value
430422 * @return $this
431423 */
432- public function with ($ key , $ value = '' ): static
424+ public function with (mixed $ key , mixed $ value = '' ): static
433425 {
434426 if (is_array ($ key )) {
435427 $ this ->appends = $ key ;
@@ -680,10 +672,9 @@ public function toJson($options = 0)
680672 * Add a search pane options on response.
681673 *
682674 * @param string $column
683- * @param mixed $options
684675 * @return $this
685676 */
686- public function searchPane ($ column , $ options , ?callable $ builder = null ): static
677+ public function searchPane ($ column , mixed $ options , ?callable $ builder = null ): static
687678 {
688679 $ options = value ($ options );
689680
@@ -748,9 +739,7 @@ public function filtering(): void
748739 protected function smartGlobalSearch ($ keyword ): void
749740 {
750741 collect (explode (' ' , $ keyword ))
751- ->reject (function ($ keyword ) {
752- return trim ($ keyword ) === '' ;
753- })
742+ ->reject (fn ($ keyword ) => trim ((string ) $ keyword ) === '' )
754743 ->each (function ($ keyword ) {
755744 $ this ->globalSearch ($ keyword );
756745 });
0 commit comments