Skip to content

Commit 7bb07d3

Browse files
committed
fixed styling | removed unnecessary imports
2 parents 9df2b19 + c814b59 commit 7bb07d3

File tree

11 files changed

+19
-34
lines changed

11 files changed

+19
-34
lines changed

src/DatatableInput.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ public function __construct(
1515
private array $rels,
1616
private array $allowedFilters,
1717
private array $allowedSortings,
18-
) {
19-
}
18+
) {}
2019

2120
public function getStart(): int
2221
{

src/DatatableService.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,20 @@
88

99
class DatatableService
1010
{
11-
1211
protected array $allowedFilters;
12+
1313
protected array $allowedRelations;
14+
1415
protected array $allowedSortings;
16+
1517
protected array $allowedSelects;
18+
1619
private int $totalRowCount;
1720

1821
public function __construct(
19-
protected Builder $query,
22+
protected Builder $query,
2023
private DatatableInput $dataTableInput
21-
)
22-
{
23-
}
24+
) {}
2425

2526
public function setAllowedFilters(array $allowedFilters): DatatableService
2627
{
@@ -55,12 +56,12 @@ public function getData(): array
5556
$query = $this->buildQuery();
5657
$data = $query->get()->toArray();
5758

58-
return array(
59+
return [
5960
'data' => $data,
6061
'meta' => [
61-
'totalRowCount' => $this->totalRowCount
62-
]
63-
);
62+
'totalRowCount' => $this->totalRowCount,
63+
],
64+
];
6465
}
6566

6667
protected function buildQuery(): Builder

src/DatatableServiceProvider.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace HamidRrj\LaravelDatatable;
44

5-
use HamidRrj\LaravelDatatable\Commands\LaravelDatatableCommand;
65
use Spatie\LaravelPackageTools\Package;
76
use Spatie\LaravelPackageTools\PackageServiceProvider;
87

src/Exceptions/InvalidParameterInterface.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22

33
namespace HamidRrj\LaravelDatatable\Exceptions;
44

5-
interface InvalidParameterInterface
6-
{
7-
}
5+
interface InvalidParameterInterface {}

src/Filter/ApplyFilter.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ class ApplyFilter
2020
public function __construct(
2121
private Builder $query,
2222
private Filter $filter,
23-
) {
24-
}
23+
) {}
2524

2625
public function apply(): Builder
2726
{

src/Filter/SearchFunctions/SearchFilter.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ abstract class SearchFilter
1010
public function __construct(
1111
protected Builder $query,
1212
protected Filter $filter,
13-
) {
14-
}
13+
) {}
1514

1615
abstract public function apply(): Builder;
1716
}

src/Sort/ApplySort.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ class ApplySort
1212
public function __construct(
1313
private Builder $query,
1414
private ?Sort $sort,
15-
) {
16-
}
15+
) {}
1716

1817
public function apply(): Builder
1918
{

src/Sort/Sort.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,13 @@ class Sort
1616
*/
1717
public function __construct(
1818
private string $id,
19-
private bool $desc,
19+
private bool $desc,
2020
private array $allowedSortings,
21-
)
22-
{
21+
) {
2322
self::$sortingValidator = SortingValidator::getInstance();
2423
self::$sortingValidator->isValid($this, $this->allowedSortings);
2524
}
2625

27-
/**
28-
* @return string
29-
*/
3026
public function getId(): string
3127
{
3228
return $this->id;

src/Validators/FilterValidator.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ class FilterValidator
1111
{
1212
private static $instance;
1313

14-
private function __construct()
15-
{
16-
}
14+
private function __construct() {}
1715

1816
public static function getInstance(): FilterValidator
1917
{

src/Validators/SortingValidator.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ class SortingValidator
99
{
1010
private static $instance;
1111

12-
private function __construct()
13-
{
14-
}
12+
private function __construct() {}
1513

1614
public static function getInstance(): SortingValidator
1715
{

0 commit comments

Comments
 (0)