Skip to content

Commit

Permalink
Run Pint
Browse files Browse the repository at this point in the history
  • Loading branch information
s-damian committed Mar 3, 2024
1 parent e837476 commit a8a2175
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
14 changes: 7 additions & 7 deletions src/Larasort.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ final public static function clearDefaultSortable(): void
* This function is especially useful for SQL queries with joins.
*
* @param array<string, string> $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
{
Expand Down
2 changes: 1 addition & 1 deletion src/LarasortLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ final public static function getIcon(string $column): string
return '<span class="'.$class.'"></span>';
}

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));

Expand Down
14 changes: 7 additions & 7 deletions src/Manual/LarasortManual.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ final public function setSortables(array $sortables): void
* This function is especially useful for SQL queries with joins.
*
* @param array<string, string> $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
{
Expand Down
2 changes: 1 addition & 1 deletion src/Relations/Related.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private function setColumnsToRelated(): void
* @param array<string> $columns
* @return array<string>
*/
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;
Expand Down

0 comments on commit a8a2175

Please sign in to comment.