From a8a2175f9f171f0dffb44a0d28aeaa80ad56bcf8 Mon Sep 17 00:00:00 2001 From: s-damian Date: Sun, 3 Mar 2024 11:35:44 +0300 Subject: [PATCH] Run Pint --- src/Larasort.php | 14 +++++++------- src/LarasortLink.php | 2 +- src/Manual/LarasortManual.php | 14 +++++++------- src/Relations/Related.php | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Larasort.php b/src/Larasort.php index a8b341f..7824c95 100644 --- a/src/Larasort.php +++ b/src/Larasort.php @@ -71,13 +71,13 @@ final public static function clearDefaultSortable(): void * This function is especially useful for SQL queries with joins. * * @param array $sortablesToTables - * - In keys: column of the "orderby" - * - In values: 'table_name.column' - * # Example with an "articles" table and its "id" column: - * // When we do an order by "id" (in URL: "?orderby=id"), we want SQL to do it on the "id" of the "articles" table. - * Larasort::setSortablesToTables([ - * 'id' => 'articles.id', - * ]); + * - In keys: column of the "orderby" + * - In values: 'table_name.column' + * # Example with an "articles" table and its "id" column: + * // When we do an order by "id" (in URL: "?orderby=id"), we want SQL to do it on the "id" of the "articles" table. + * Larasort::setSortablesToTables([ + * 'id' => 'articles.id', + * ]); */ final public static function setSortablesToTables(array $sortablesToTables): void { diff --git a/src/LarasortLink.php b/src/LarasortLink.php index 7e14a98..b63fea9 100644 --- a/src/LarasortLink.php +++ b/src/LarasortLink.php @@ -81,7 +81,7 @@ final public static function getIcon(string $column): string return ''; } - final public static function getLink(string $column, string $label = null): string + final public static function getLink(string $column, ?string $label = null): string { $labelToShow = $label ?? ucfirst(str_replace(['_', config('larasort.relation_column_separator')], ' ', $column)); diff --git a/src/Manual/LarasortManual.php b/src/Manual/LarasortManual.php index eccb11c..753880e 100644 --- a/src/Manual/LarasortManual.php +++ b/src/Manual/LarasortManual.php @@ -55,13 +55,13 @@ final public function setSortables(array $sortables): void * This function is especially useful for SQL queries with joins. * * @param array $sortablesToTables - * - In keys: column of the "orderby" - * - In values: 'table_name.column' - * # Example with an "articles" table and its "id" column: - * // When we do an order by "id" (in URL: "?orderby=id"), we want SQL to do it on the "id" of the "articles" table. - * Larasort::setSortablesToTables([ - * 'id' => 'articles.id', - * ]); + * - In keys: column of the "orderby" + * - In values: 'table_name.column' + * # Example with an "articles" table and its "id" column: + * // When we do an order by "id" (in URL: "?orderby=id"), we want SQL to do it on the "id" of the "articles" table. + * Larasort::setSortablesToTables([ + * 'id' => 'articles.id', + * ]); */ final public function setSortablesToTables(array $sortablesToTables): void { diff --git a/src/Relations/Related.php b/src/Relations/Related.php index 37164dc..ef55c65 100644 --- a/src/Relations/Related.php +++ b/src/Relations/Related.php @@ -122,7 +122,7 @@ private function setColumnsToRelated(): void * @param array $columns * @return array */ - private function setColumns(string $table, array|string $columns = null): array + private function setColumns(string $table, array|string|null $columns = null): array { if ($columns !== null) { $columns = ! is_array($columns) ? explode(',', $columns) : $columns;