Skip to content

Commit 54c2334

Browse files
nikuscsgithub-actions[bot]
authored andcommitted
Fix styling
1 parent f71da89 commit 54c2334

File tree

13 files changed

+27
-63
lines changed

13 files changed

+27
-63
lines changed

src/Core/Concerns/EvaluatesClosures.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,17 @@ trait EvaluatesClosures
88
{
99
/**
1010
* The identifier used to inject the component into the evaluation closure.
11-
*
12-
* @var string
1311
*/
1412
protected string $evaluationIdentifier;
1513

1614
/**
1715
* The parameters that should be removed from the evaluation closure.
18-
*
19-
* @var array
2016
*/
2117
protected array $evaluationParametersToRemove = [];
2218

2319
/**
2420
* Stolen from Filament, evaluate the closure with given params, and exclude some.
2521
*
26-
* @param $value
27-
* @param array $parameters
28-
* @param array $exceptParameters
2922
* @return mixed
3023
*/
3124
protected function evaluate($value, array $parameters = [], array $exceptParameters = [])
@@ -48,8 +41,6 @@ protected function evaluate($value, array $parameters = [], array $exceptParamet
4841

4942
/**
5043
* Get the default params that should be always injected
51-
*
52-
* @return array
5344
*/
5445
protected function getDefaultEvaluationParameters(): array
5546
{
@@ -59,8 +50,6 @@ protected function getDefaultEvaluationParameters(): array
5950
/**
6051
* Resolve the given evaluation parameter.
6152
*
62-
* @param string $parameter
63-
* @param Closure $value
6453
* @return mixed|null
6554
*/
6655
protected function resolveEvaluationParameter(string $parameter, Closure $value)
@@ -74,9 +63,6 @@ protected function resolveEvaluationParameter(string $parameter, Closure $value)
7463

7564
/**
7665
* Determine if the given evaluation parameter should be removed.
77-
*
78-
* @param string $parameter
79-
* @return bool
8066
*/
8167
protected function isEvaluationParameterRemoved(string $parameter): bool
8268
{

src/Core/Concerns/Makable.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ trait Makable
66
{
77
/**
88
* Quick static constructor.
9-
*
10-
* @param array $args
11-
* @return static
129
*/
1310
public static function make(array $args = []): static
1411
{

src/Core/Integrations/VanillaHybridly.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ public function __construct(
1515
protected ?string $url = null,
1616
protected array $query = [],
1717
protected array $options = [],
18-
){}
18+
) {
19+
}
1920

2021
public function reload(bool|Closure $reload = true): static
2122
{
@@ -48,21 +49,24 @@ public function preserve(bool|Closure $state = true, bool|Closure $scroll = true
4849
public function replace(bool|Closure $replace = true): static
4950
{
5051
$this->options['replace'] = $this->evaluate($replace);
52+
5153
return $this;
5254
}
5355

5456
public function method(string|Closure $method = 'POST'): static
5557
{
5658
$this->options['method'] = $this->evaluate($method);
59+
5760
return $this;
5861
}
5962

6063
public function post(array|Closure $data = []): static
6164
{
6265
$data = $this->evaluate($data);
63-
if(!empty($data)){
66+
if (! empty($data)) {
6467
$this->data($data);
6568
}
69+
6670
return $this->method();
6771
}
6872

@@ -94,6 +98,7 @@ public function only(array|Closure $keys): static
9498
$this->evaluate($keys)
9599
)
96100
);
101+
97102
return $this;
98103
}
99104

@@ -105,6 +110,7 @@ public function except(array|Closure $keys): static
105110
$this->evaluate($keys)
106111
)
107112
);
113+
108114
return $this;
109115
}
110116

@@ -116,6 +122,7 @@ public function headers(array|Closure $headers): static
116122
$this->evaluate($headers)
117123
)
118124
);
125+
119126
return $this;
120127
}
121128

@@ -125,6 +132,7 @@ public function data(array|Closure $data = []): static
125132
Arr::get($this->options, 'data', []),
126133
$this->evaluate($data)
127134
);
135+
128136
return $this;
129137
}
130138

@@ -136,6 +144,7 @@ public function query(array|Closure $params = []): self
136144
$params
137145
)
138146
);
147+
139148
return $this;
140149
}
141150

@@ -147,6 +156,7 @@ public function options(array|Closure $options = []): static
147156
$this->evaluate($options)
148157
)
149158
);
159+
150160
return $this;
151161
}
152162

src/Core/Integrations/VanillaInertia.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ public function __construct(
1515
protected ?string $url = null,
1616
protected array $query = [],
1717
protected array $options = [],
18-
){}
18+
) {
19+
}
1920

2021
public function reload(bool|Closure $reload = true): static
2122
{
@@ -48,21 +49,24 @@ public function preserve(bool|Closure $state = true, bool|Closure $scroll = true
4849
public function replace(bool|Closure $replace = true): static
4950
{
5051
$this->options['replace'] = $this->evaluate($replace);
52+
5153
return $this;
5254
}
5355

5456
public function method(string|Closure $method = 'POST'): static
5557
{
5658
$this->options['method'] = $this->evaluate($method);
59+
5760
return $this;
5861
}
5962

6063
public function post(array|Closure $data = []): static
6164
{
6265
$data = $this->evaluate($data);
63-
if(!empty($data)){
66+
if (! empty($data)) {
6467
$this->data($data);
6568
}
69+
6670
return $this->method();
6771
}
6872

@@ -94,6 +98,7 @@ public function only(array|Closure $keys): static
9498
$this->evaluate($keys)
9599
)
96100
);
101+
97102
return $this;
98103
}
99104

@@ -105,6 +110,7 @@ public function headers(array|Closure $headers): static
105110
$this->evaluate($headers)
106111
)
107112
);
113+
108114
return $this;
109115
}
110116

@@ -114,6 +120,7 @@ public function data(array|Closure $data = []): static
114120
Arr::get($this->options, 'data', []),
115121
$this->evaluate($data)
116122
);
123+
117124
return $this;
118125
}
119126

@@ -125,6 +132,7 @@ public function query(array|Closure $params = []): self
125132
$params
126133
)
127134
);
135+
128136
return $this;
129137
}
130138

@@ -136,6 +144,7 @@ public function options(array|Closure $options = []): static
136144
$this->evaluate($options)
137145
)
138146
);
147+
139148
return $this;
140149
}
141150

@@ -149,7 +158,7 @@ public function toArray(): array
149158
'method' => 'GET',
150159
'preserveState' => true,
151160
'preserveScroll' => true,
152-
],$this->options)),
161+
], $this->options)),
153162
];
154163
}
155164

src/Datatables/Actions/Concerns/HasRedirect.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,25 @@
33
namespace Flavorly\VanillaComponents\Datatables\Actions\Concerns;
44

55
use Closure;
6-
use Flavorly\VanillaComponents\Core\Integrations\VanillaInertia;
76

87
trait HasRedirect
98
{
109
protected ?string $redirectTo = null;
10+
1111
protected bool $redirectToNewTab = false;
1212

1313
public function redirect(Closure|string $url, Closure|bool $openInNewTab = false): static
1414
{
1515
$this->redirectTo = $this->evaluate($url);
1616
$this->redirectToNewTab = $this->evaluate($openInNewTab);
17+
1718
return $this;
1819
}
1920

2021
public function redirectToRoute(Closure|string $route, Closure|bool $openInNewTab = false): static
2122
{
2223
$this->redirect(route($this->evaluate($route)), $openInNewTab);
24+
2325
return $this;
2426
}
2527

src/Datatables/Concerns/HasOptions.php

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

77
trait HasOptions
88
{
9-
/** @var array */
109
protected array $options = [];
1110

1211
public function options(): array|Options

src/Datatables/Concerns/HasPolling.php

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

77
trait HasPolling
88
{
9-
/** @var array */
109
protected array $pollingOptions = [];
1110

1211
public function polling(): array|Polling

src/Datatables/Concerns/HasTranslations.php

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

55
trait HasTranslations
66
{
7-
/** @var array */
87
protected array $translations = [];
98

109
protected function getDefaultTranslations(): array

src/Datatables/Concerns/InteractsWithQueryBuilder.php

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,16 @@ trait InteractsWithQueryBuilder
1919
{
2020
/**
2121
* Stores the query object
22-
*
23-
* @var Builder|ScoutBuilder|Closure|null
2422
*/
2523
protected Builder|ScoutBuilder|null|Closure $query = null;
2624

2725
/**
2826
* Stores the data comming from the client side
29-
*
30-
* @var RequestPayload
3127
*/
3228
protected RequestPayload $data;
3329

3430
/**
3531
* The actual query builder instance provided by the user.
36-
*
37-
* @return mixed
3832
*/
3933
public function query(): mixed
4034
{
@@ -53,8 +47,6 @@ protected function getQuery()
5347

5448
/**
5549
* Boot the query and save it on the instance.
56-
*
57-
* @return void
5850
*/
5951
public function setupQuery(): void
6052
{
@@ -81,9 +73,6 @@ public function withQuery(mixed $query): static
8173

8274
/**
8375
* Attempts to resolve the query from a string, class or a model
84-
*
85-
* @param mixed|null $queryOrModel
86-
* @return Builder
8776
*/
8877
protected function resolveQueryOrModel(mixed $queryOrModel = null): Builder
8978
{
@@ -107,10 +96,6 @@ protected function resolveQueryOrModel(mixed $queryOrModel = null): Builder
10796

10897
/**
10998
* Apply the user provided filters using the follow method
110-
*
111-
* @param Builder $query
112-
* @param RequestPayload $payload
113-
* @return Builder
11499
*/
115100
protected function applyQueryFilters(Builder $query, RequestPayload $payload): Builder
116101
{
@@ -127,10 +112,6 @@ protected function applyQueryFilters(Builder $query, RequestPayload $payload): B
127112

128113
/**
129114
* Apply the sorting using the following method
130-
*
131-
* @param Builder $query
132-
* @param RequestPayload $payload
133-
* @return Builder
134115
*/
135116
protected function applyQuerySorting(Builder $query, RequestPayload $payload): Builder
136117
{
@@ -146,10 +127,6 @@ protected function applyQuerySorting(Builder $query, RequestPayload $payload): B
146127

147128
/**
148129
* Apply the search using the following method, supporting scout if the class uses scout.
149-
*
150-
* @param Builder $query
151-
* @param RequestPayload $payload
152-
* @return Builder
153130
*/
154131
protected function applySearch(Builder $query, RequestPayload $payload): Builder
155132
{
@@ -181,9 +158,6 @@ protected function applySearch(Builder $query, RequestPayload $payload): Builder
181158
/**
182159
* Transform the Laravel pagination with Vanilla Datatable Pagination structure
183160
* The ideia was origonally taken from Reink at PingCRM Demo
184-
*
185-
* @param LengthAwarePaginator $paginator
186-
* @return array
187161
*/
188162
protected function transformPagination(LengthAwarePaginator $paginator): array
189163
{
@@ -270,7 +244,6 @@ protected function transformPagination(LengthAwarePaginator $paginator): array
270244
/**
271245
* Process an action once is dispatched from the frontend to the backend
272246
*
273-
* @return void
274247
*
275248
* @throws Exception
276249
*/
@@ -290,8 +263,6 @@ protected function dispatchAction(): void
290263
* otherwise we can inject the user provided query into the table.
291264
*
292265
*
293-
* @param Builder|null $queryOrModel
294-
* @return array|Collection
295266
*
296267
* @throws Exception
297268
*/

src/Datatables/Http/Payload/Concerns/CanSelectAllRows.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ trait CanSelectAllRows
66
{
77
/**
88
* Checks if all is selected
9-
*
10-
* @var bool
119
*/
1210
protected bool $isAllSelected = false;
1311

0 commit comments

Comments
 (0)